You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have class Payment < ActiveRecord::Base and class Osmp < Payment.
When I osmp = Factory(:osmp) then I got error ActiveRecord::SubclassNotFound:
The single-table inheritance mechanism failed to locate the subclass: 'type'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Deal.inheritance_column to use another column for that information.
This is a bug or something I did not do so?
The text was updated successfully, but these errors were encountered:
If you're using STI with factory_girl, you'll need to override the build_class or avoid child factories, since child factories share a build class with their parent by default.
FactoryGirl.define do
factory :payment do
# common fields
end
factory :osmp, :class => 'Osmp' do
# osmp-specific fields
end
end
I have
class Payment < ActiveRecord::Base
andclass Osmp < Payment
.When I
osmp = Factory(:osmp)
then I got errorActiveRecord::SubclassNotFound
:This is a bug or something I did not do so?
The text was updated successfully, but these errors were encountered: