Sha256: b5be57229e84fc2a5a8f4f86c35c0ecb09c60a34a3892e5053f803a73333404b

Contents?: true

Size: 453 Bytes

Versions: 3

Compression:

Stored size: 453 Bytes

Contents

class Reservation < ActiveRecord::Base
  has_many :parties
  has_many :lodgings
  has_many :party_lodgings, :through => :lodgings

  include GraphMediator
  mediate :dependencies => [Lodging, Party], 
    :when_reconciling => :reconcile,
    :when_cacheing => :cache

  def lodge(party, options = {})
    lodging = options[:in]
    party.party_lodgings.create(:lodging_id => lodging)
  end

  def reconcile; :reconcile; end
  def cache; :cache; end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graph_mediator-0.2.3 spec/reservations/reservation.rb
graph_mediator-0.2.2 spec/reservations/reservation.rb
graph_mediator-0.2.1 spec/reservations/reservation.rb