Permalink
Browse files

Make sure Model#touch doesn't try to update non existing columns

  • Loading branch information...
1 parent 1a26036 commit a49a84f269d0e3612dd4ecd1820c7f1cb4ebc205 @lifo lifo committed Dec 30, 2010
Showing with 4 additions and 2 deletions.
  1. +1 −1 activerecord/lib/active_record/timestamp.rb
  2. +3 −1 activerecord/test/models/task.rb
@@ -65,7 +65,7 @@ def should_record_timestamps?
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

0 comments on commit a49a84f

Please sign in to comment.