mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make sure Model#touch doesn't try to update non existing columns
This commit is contained in:
parent
eb1e727544
commit
573fd39e22
2 changed files with 4 additions and 2 deletions
|
@ -67,7 +67,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def timestamp_attributes_for_update_in_model
|
||||
timestamp_attributes_for_update.select { |c| respond_to?(c) }
|
||||
timestamp_attributes_for_update.select { |c| self.class.column_names.include?(c.to_s) }
|
||||
end
|
||||
|
||||
def timestamp_attributes_for_update #:nodoc:
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
class Task < ActiveRecord::Base
|
||||
|
||||
def updated_at
|
||||
ending
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue