1
0
Fork 0
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:
Pratik Naik 2010-12-30 18:41:53 +00:00
parent eb1e727544
commit 573fd39e22
2 changed files with 4 additions and 2 deletions

View file

@ -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:

View file

@ -1,3 +1,5 @@
class Task < ActiveRecord::Base
def updated_at
ending
end
end