multiple_table_inheritance
multiple_table_inheritance copied to clipboard
Multiple Table Inheritance is a plugin designed to allow for multiple table inheritance between your database tables and your ActiveRecord models.
Is it possible to do something like: ``` ruby class Employee < ActiveRecord::Base acts_as_superclass belongs_to :team def give_date self.training_completed_at end end class Programmer < ActiveRecord::Base inherits_from :employee, :methods => true...
I have two AR models: Offer and TranslationOffer, the latter "inheriting" from the former. The first time I fetch an Offer, the correct object is returned: ``` > Offer.find 1...
I created a fresh project using your gem to create an inheritance model. I scaffolded two basic models: ``` Shape: area:integer, color:string # acts_as_superclass Circle: radius:integer # inherits_from :shape ```...
Hi first thanks for this gem, very usefull but im faced to a problem here my models ``` class ads < ActiveRecord::Base attr_accessible : category_id, title, text, :ad_detail_attributes has_one :ad_detail,...
Good day, @mhuggins ! According to `README` we can use `class_name` option in `inherits_from` method. I thought that this option is given to some Rails' method. Yes, [here](https://github.com/mhuggins/multiple_table_inheritance/blob/master/lib/multiple_table_inheritance/child/base.rb#L31). But according...
Hey little issue i came across. ``` ruby class Item < ActiveRecord::Base acts_as_superclass has_many :rows end class Invoice < ActiveRecord::Base inherits_from :item end class Row < ActiveRecord::Base belongs_to :item end...
If I use Rails 3.1 has_secure_password in the parent, creating a new record fails with ActiveRecord::UnknownAttributeError: unknown attribute: password ``` ruby sub_user = SubUser.create!(:password => "foo", :email => "foo") ```...
I'm using Guard with Spork to dynamically reload some classes, including my models : ``` Spork.each_run do reloaded_files = %w( app/classes/**/*.rb app/controllers/**/*.rb app/helpers/**/*.rb app/models/**/*.rb ) reloaded_files.each do |pattern| Dir["#{Rails.root}/#{pattern}"].each do...
Hi When adding a default scope to the base model, I got: ``` Failure/Error: Unable to find matching line from backtrace SystemStackError: stack level too deep # /home/..gems/activerecord-3.2.9/lib/active_record/dynamic_finder_match.rb:14 ```
If I have "title" in my superclass, I can't call "find_by_title" directly from its children. Error I get is that the method doesn't exist.