Created
November 18, 2008 18:12
-
-
Save graysky/26199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Note to self: Normally to turn off ActiveRecord timestamps you would set: | |
# ActiveRecord::Base.record_timestamps = false | |
# in the configuration. Timestamp.rb uses class_inheritable_accessor to copy that | |
# value for each AR model. So to change it at runtime (ex. tests) it needs to be | |
# accessed through the class directly. | |
myobj.class.record_timestamps = false | |
# Set timestamp manually to simulate old objects | |
myobj.updated_at = Time.now - 2.months.ago | |
myobj.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment