aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/timestamp.rb
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-09-21 22:49:20 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-09-21 22:49:20 +0530
commit3b7947ea31489afd020419e3c22ee01ce4809103 (patch)
tree447a5e56657c457a55004fc445699cfa581d625b /activerecord/lib/active_record/timestamp.rb
parentf74ddc8a4c748c3fb8ae7e03a5a211f87c025182 (diff)
parent7c0e3b87efca780b086ff0c458fa78a6db444b4c (diff)
downloadrails-3b7947ea31489afd020419e3c22ee01ce4809103.tar.gz
rails-3b7947ea31489afd020419e3c22ee01ce4809103.tar.bz2
rails-3b7947ea31489afd020419e3c22ee01ce4809103.zip
Merge branch 'master' of github.com:lifo/docrails
Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/configurable.rb activesupport/lib/active_support/core_ext/module/deprecation.rb guides/source/action_controller_overview.md guides/source/active_support_core_extensions.md guides/source/ajax_on_rails.textile guides/source/association_basics.textile guides/source/upgrading_ruby_on_rails.md While resolving conflicts, I have chosen to ignore changes done in docrails at some places - these will be most likely 1.9 hash syntax changes.
Diffstat (limited to 'activerecord/lib/active_record/timestamp.rb')
-rw-r--r--activerecord/lib/active_record/timestamp.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/timestamp.rb b/activerecord/lib/active_record/timestamp.rb
index c32e0d6bf8..bf95ccb298 100644
--- a/activerecord/lib/active_record/timestamp.rb
+++ b/activerecord/lib/active_record/timestamp.rb
@@ -40,13 +40,13 @@ module ActiveRecord
config_attribute :record_timestamps, instance_writer: true
end
- def initialize_dup(other)
+ def initialize_dup(other) # :nodoc:
clear_timestamp_attributes
end
private
- def create #:nodoc:
+ def create
if self.record_timestamps
current_time = current_time_from_proper_timezone
@@ -60,7 +60,7 @@ module ActiveRecord
super
end
- def update(*args) #:nodoc:
+ def update(*args)
if should_record_timestamps?
current_time = current_time_from_proper_timezone
@@ -89,19 +89,19 @@ module ActiveRecord
timestamp_attributes_for_create_in_model + timestamp_attributes_for_update_in_model
end
- def timestamp_attributes_for_update #:nodoc:
+ def timestamp_attributes_for_update
[:updated_at, :updated_on]
end
- def timestamp_attributes_for_create #:nodoc:
+ def timestamp_attributes_for_create
[:created_at, :created_on]
end
- def all_timestamp_attributes #:nodoc:
+ def all_timestamp_attributes
timestamp_attributes_for_create + timestamp_attributes_for_update
end
- def current_time_from_proper_timezone #:nodoc:
+ def current_time_from_proper_timezone
self.class.default_timezone == :utc ? Time.now.utc : Time.now
end