Making sure you implement the ActiveModel interface fully

April 8, 2011 Mike Gehard

Rails 3 brings with it ActiveModel.

ActiveModel give you a way to make non-db backed models look like db backed models to your views and controllers. See this post for a good explanation of what using ActiveModel buys you.

ActiveModel gives you a great way to test that your class implements the minimum ActiveModel interface: ActiveModel::Lint::Tests

Check out this gist for the details for using these tests in RSpec:

About the Author

Biography

More Content by Mike Gehard
Previous
New Tech Talk: Librato Silverline: Application Monitoring and Workload Management Service
New Tech Talk: Librato Silverline: Application Monitoring and Workload Management Service

Joseph Ruscio, Co-founder and CTO of Librato, demonstrates Silverline, their new service providing applicat...

Next
Librato Silverline: Application Monitoring and Workload Management Service
Librato Silverline: Application Monitoring and Workload Management Service

Joe Ruscio, CTO of Librato, demonstrates Silverline, an app-centric monitoring and workload management serv...

How do you measure digital transformation?

Take the Benchmark