1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

Ruby on Rails: Dangers of Model in Session

  1. Clicks today:
    0
  2. Clicks this month:
    0
  3. Overall rating:
    3.00/5

Ruby on Rails » Best Practices — about 9 years ago
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.

Comments

Your Comment

You must be logged in to post a comment.