class Parent < ActiveRecord::Base
include Tenacity
t_has_many :cars, as: :owner
end
class Child < Parent
attr_accessible :type
end
class Car
include Mongoid::Document
include Mongoid::Timestamps
include Tenacity
t_belongs_to :owner, polymorphic: true
attr_accessible :owner
end
Running the command on console: car = Car.new(owner: Child.new) I have the result:
car.owner_type: "Child"
But the expected behavior from polymorphic using ActiveRecord is:
car.owner_type: "Parent"
I have the following code:
Running the command on console:
car = Car.new(owner: Child.new)
I have the result:car.owner_type: "Child"
But the expected behavior from polymorphic using ActiveRecord is:
car.owner_type: "Parent"