RailsCasts Pro episodes are now free!

Learn more or hide this

Alexandre de Oliveira's Profile

GitHub User: kurko

Site: http://twitter.com/kurko

Comments by Alexandre de Oliveira


You're defining a class name Portrait as descending from ActiveRecord::Base.

Then you redefining it without ActiveRecord. You can't do that.

Suggestion: wrap your Portrait class (non ActiveRecord) in a module with the name of you app. If you app is called Store, so

module Store
  class Portrait


Also, don't put a module inside the class like this. Module are not meant to be used as classes.


What you can do is set config.rollout in your env file and then use App::Application.config.rollout.

For something more elaborated like App::Application.rollout?, you can create your own mixin and have method_missing verifying the actual variable.