module Itemable::ActsAsItemable::BelongsToItems::ClassMethods

Public Instance Methods

belongs_to_items(association_name, options={}) click to toggle source
# File lib/itemable/acts_as_itemable.rb, line 78
def belongs_to_items(association_name, options={})
  default_options = {
    through: :item_parents,
    source: :parent,
    source_type: association_name.to_s.classify
  }
  has_many association_name, default_options.merge(options.symbolize_keys)
end