There is a better way to do this in Rails 3: http://railscasts.com/episodes/219-active-model
More Related Contents:
- Rails ActiveRecord methods in different places [closed]
- ActiveRecord.find(array_of_ids), preserving order
- How do I replace accented Latin characters in Ruby?
- Using Rails serialize to save hash to database
- Rails 3: Get Random Record
- Rails 5: ActiveRecord OR query
- How to handle Ruby on Rails error: “Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'”
- Altering the primary key in Rails to be a string
- LEFT OUTER joins in Rails 3
- Rails: ActiveRecord query based on association value
- How to test for (ActiveRecord) object equality
- Rails 3, has_one / has_many with lambda condition
- How do i work with two different databases in rails with active records?
- Rails ActiveRecord: Find All Users Except Current User
- query , can not select column count
- How to use ActiveRecord in a ruby script outside Rails?
- Regular expressions with validations in RoR 4
- Using helpers in model: how do I include helper dependencies?
- What are the brackets [5.1] after ActiveRecord Migration and how does it work? [duplicate]
- delete_all vs destroy_all?
- Converting an array of objects to ActiveRecord::Relation
- Rails 3.1 limit user created objects
- Store the day of the week and time?
- Is there a way to avoid automatically updating Rails timestamp fields?
- Rails: Overriding ActiveRecord association method
- Rails Object Relationships and JSON Rendering
- OO Design in Rails: Where to put stuff
- Find number of months between two Dates in Ruby on Rails
- Ruby: problem installing EventMachine under Windows 7
- Rails devise: user_signed_in? not working