Skip to content

Instantly share code, notes, and snippets.

@tomas-stefano
Created November 11, 2010 13:31
Show Gist options
  • Select an option

  • Save tomas-stefano/672507 to your computer and use it in GitHub Desktop.

Select an option

Save tomas-stefano/672507 to your computer and use it in GitHub Desktop.
Set Timestamps manually in Rails
###### One way
ActiveRecord::Base.record_timestamps = false
# set timestamps manually
ActiveRecord::Base.record_timestamps = true
###### Other way
class MyModel < ActiveRecord::Base
end
MyModel.record_timestamps = false
# set timestamps manually
MyModel.record_timestamps = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment