Web Development

Sponsored by

Be careful when storing a model in a session. It will behave differently than you expect and can easily get out of sync with the database. Instead of storing the model directly in the session, store the id to the model and use that to fetch it from the database.

  • Currently 0 stars out of 5
  • 1
  • 2
  • 3
  • 4
  • 5
0 (0 votes)

Did you know ActiveRecord provides class methods for performing calculations on models? You can even use these methods through associations.

  • Currently 5.00 stars out of 5
  • 1
  • 2
  • 3
  • 4
  • 5
5.00 (1 votes)
1

2 Ruby on Rails Models Tutorials

Page 1 of 1