Module: ActAsReleasable::ClassMethods

Defined in:
lib/act_as_releasable.rb

Instance Method Summary collapse

Instance Method Details

#act_as_releasable(options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/act_as_releasable.rb', line 6

def act_as_releasable(options = {})
  send :include, InstanceMethods

  class_attribute :releasable_collections
  self.releasable_collections = (options[:collections] || [])

  has_one :releasable_candidate, :as => :item
  unless self.releasable_collections.empty?
    has_many :releasable_candidate_items, :as => :item
  end

end