secondbase
secondbase copied to clipboard
Fixture Inserts Use Model's Connection
Make sure work in master handles fixtures to secondbase models.
@hmadison Had a great idea to solve this by tracking SecondBase descendants and calling set_fixture_class with the right data/tablename.
Here is an example of tracking subclasses that Rails::Railtie does too.
class << self
def subclasses
@subclasses ||= []
end
def inherited(base)
unless base.abstract_railtie?
subclasses << base
end
end
end
When doing this, we should also consider doing a freedom method chain wrapped with a nice SecondBase::Base.connection.disable_referential_integrity { ... } block call.