laserlemon / vestal_versions

Keep a DRY history of your ActiveRecord models' changes
MIT License
933 stars 229 forks source link

ActionController::RoutingError (undefined method `class_inheritable_accessor' for #<Class:0x00000005072600> #81

Open iyerkartikv opened 12 years ago

iyerkartikv commented 12 years ago

I am new to ruby and rails. I am using ruby 1.92 and rails 3.2.3. In my web application I am trying to use vestal_versions, in my model USER, I have written the following code:

class User < ActiveRecord::Base versioned attr_accessible :email, :name end.

However now when I try to create to run my server, which in turn tries to show the index page of users, it errors out giving below error.

Can anyone please let me know how I can fix this? I searched for this issue in google and other forums however could not find any solution to the same hence posting this new issue.

Thanks and regards, Kartik

DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in VestalVersions::Deletion instead. (called from include at /usr/local/lib/ruby/gems/1.9.1/bundler/gems/vestal_versions-6273df533f85/lib/vestal_versions.rb:118)

ActionController::RoutingError (undefined method class_inheritable_accessor' for #<Class:0x00000005072600>): app/models/user.rb:3:inclass:User' app/models/user.rb:1:in <top (required)>' app/controllers/users_controller.rb:1:in<top (required)>'

zhangyuan commented 12 years ago

According to this article http://www.strictlyuntyped.com/2010/05/tweaking-on-rails-30-3-classattribute.html , should class_attribute be used instead of class_inheritable_accessor ?

hrasguido commented 12 years ago

same error

pboling commented 11 years ago

Getting this same error... well almost:

gems/activerecord-3.2.11/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `class_inheritable_accessor' for #<Class:0x007febfd7582d0> (NoMethodError)
pboling commented 11 years ago

Fixes are in trunk, but the gem has not been released with these fixes yet. To get it to work with rails 3.2:

gem 'vestal_versions', github: 'laserlemon/vestal_versions'
pboling commented 11 years ago

But there is another error related to the attr_accessible still on master. This pull request has a fix!

gem 'vestal_versions', github: 'justintanner/vestal_versions'