From 5178e641750d4e3f8419c8e6cf3ab7e7cb48a880 Mon Sep 17 00:00:00 2001 From: Franck Verrot Date: Tue, 25 Jan 2011 23:27:27 +0100 Subject: Added timestamp_attributes_for_create_in_model Signed-off-by: Santiago Pastorino --- activerecord/lib/active_record/timestamp.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb index 5617adea1f..38cc2c9694 100644 --- a/activerecord/lib/active_record/timestamp.rb +++ b/activerecord/lib/active_record/timestamp.rb @@ -66,6 +66,10 @@ module ActiveRecord self.record_timestamps && (!partial_updates? || changed? || (attributes.keys & self.class.serialized_attributes.keys).present?) end + def timestamp_attributes_for_create_in_model + timestamp_attributes_for_create.select { |c| self.class.column_names.include?(c.to_s) } + end + def timestamp_attributes_for_update_in_model timestamp_attributes_for_update.select { |c| self.class.column_names.include?(c.to_s) } end -- cgit v1.2.3