Module: ModelManage::Metadata
- Included in:
- Mongoid::Relations::Metadata
- Defined in:
- lib/model_manage/mongoid_rails_erd.rb
Instance Method Summary collapse
- #active_record ⇒ Object
- #belongs_to? ⇒ Boolean
- #check_validity! ⇒ Object
- #collection? ⇒ Boolean
- #options ⇒ Object
- #through_reflection ⇒ Object
Instance Method Details
#active_record ⇒ Object
6 7 8 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 6 def active_record form.owner end |
#belongs_to? ⇒ Boolean
12 13 14 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 12 def belongs_to? [:referenced_in, :embedded_in].member? macro end |
#check_validity! ⇒ Object
9 10 11 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 9 def check_validity! nil end |
#collection? ⇒ Boolean
15 16 17 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 15 def collection? not belongs_to? end |
#options ⇒ Object
3 4 5 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 3 def form.data.merge(self) end |
#through_reflection ⇒ Object
18 19 20 |
# File 'lib/model_manage/mongoid_rails_erd.rb', line 18 def through_reflection active_record.relations[ form.[:through].to_s ] end |