Module: Polytag::TagGroup::Owner
- Defined in:
- lib/polytag/tag_group/owner.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/polytag/tag_group/owner.rb', line 2 def self.included(base) base.has_many :polytag_tag_groups, as: :owner, class_name: '::Polytag::TagGroup' base.has_many :polytag_owned_tags, through: :polytag_tag_groups, source: :polytag_tag, class_name: '::Polytag::Tag' base.__send__(:alias_method, :tag_groups, :polytag_tag_groups) unless base.method_defined?(:tag_relations) base.__send__(:alias_method, :owned_tags, :polytag_owned_tags) unless base.method_defined?(:owned_tags) end |