Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot instantiate an subclass #52

Open
sergio101 opened this issue Nov 4, 2013 · 3 comments
Open

Cannot instantiate an subclass #52

sergio101 opened this issue Nov 4, 2013 · 3 comments

Comments

@sergio101
Copy link

I have my classes all set up, but i cannot instantiate a subclass. Here is what i am getting:

[1] pry(main)> AssemblyTypeItem.create :name => 'this is it'

NoMethodError: undefined method update' for #<ActiveModel::MassAssignmentSecurity::WhiteList: {}> from /Users/xxx/.rvm/gems/ruby-1.9.3-p448/gems/acts_as_relation-0.1.2/lib/active_record/acts_as_relation.rb:106:inincluded'

anyone have any ideas? thanks in advance..

here is what everything looks like:

environment
rails (3.0.20)
acts_as_relation (0.1.2)
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin12.5.0]

classes
class Item < ActiveRecord::Base                                                                                                                                                                                                             
   acts_as_superclass
   attr_accessible :type, :name, :key
end

class AssemblyTypeItem < ActiveRecord::Base
   acts_as :item
   attr_accessible :comment
end

schema
create_table "assembly_type_items", :force => true do |t|
     t.string   "comment"
     t.datetime "created_at"
     t.datetime "updated_at"
end

create_table "items", :force => true do |t|                                                                                                                                                                                             
     t.integer  "as_item_id"
     t.string   "as_item_type"
     t.string   "name"
     t.string   "key"
     t.string   "description"
     t.datetime "created_at"
     t.datetime "updated_at"
 end
@edelpino
Copy link

edelpino commented Nov 4, 2013

class CreateItems < ActiveRecord::Migration
  def self.up
    create_table :items, :as_relation_superclass => true do |t|
      t.string :name
      t.string :key
      t.string :description

      t.timestamps
    end
  end
end

@wtian
Copy link

wtian commented Apr 30, 2014

Is this resolved at last? I seem to have the same issue with Rails 3.0.20 and acts_as_relation 0.1.2

@hzamani
Copy link
Owner

hzamani commented Jul 29, 2014

we currently do not support rails 3, patches are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants