1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00
aasm/spec/models/mongoid/mongoid_relationships.rb
2016-02-26 03:06:35 +05:30

26 lines
393 B
Ruby

class Parent
include Mongoid::Document
include AASM
field :status, :type => String
has_many :childs
aasm column: :status do
state :unknown_scope
state :new
end
end
class Child
include Mongoid::Document
include AASM
field :parent_id
field :status, :type => String
belongs_to :parent
aasm column: :status do
state :unknown_scope
state :new
end
end