petehamilton / citier

CITIER (Class Inheritance & Table Inheritance Embeddings for Rails) is a solution for simple Multiple Class Inheritance in Rails.
88 stars 24 forks source link

attr_accessible of root class needs to inherit child attributes #19

Open morgz opened 13 years ago

morgz commented 13 years ago

If you have an attr_accesible on the root class which doesn't include child classes attributes then they won't update when mass assigning.

DouweM commented 13 years ago

What exactly do you mean? This works fine for me:

class Status < ActiveRecord::Base
    attr_accessible :text
end

class LinkStatus < Status
    attr_accessible :link_url
end

pry(main)> LinkStatus.new( :text => "Google", :link_url => "http://www.google.com/" )
citier -> Non Root Class
citier -> table_name -> link_statuses
citier -> tablename (view) -> view_link_statuses
=> #<LinkStatus id: nil, text: "Google", type: "LinkStatus", link_url: "http://www.google.com/", [...]>
morgz commented 13 years ago

Not entirely sure.. will review again this week. Looks like you're doing some great work on the gem! Thanks!

DouweM commented 13 years ago

iOS developers playing with Rails unite ;-)