Sha256: 13bbf65d5a21734928af80a2a8e4bb1bf768a4118573f1b21e2217addfe64bbd

Contents?: true

Size: 435 Bytes

Versions: 18

Compression:

Stored size: 435 Bytes

Contents

class Room < ActiveRecord::Base
  set_primary_keys :dorm_id, :room_id
  belongs_to :dorm
  has_many :room_assignments, :foreign_key =>  [:dorm_id, :room_id]
  has_many :room_attribute_assignments, :foreign_key =>  [:dorm_id, :room_id]
  has_many :room_attributes, :through => :room_attribute_assignments
  
  def find_custom_room_attributes
    room_attributes.find(:all, :conditions => ["room_attributes.name != ?", "keg"])
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.11 test/fixtures/room.rb
composite_primary_keys-5.0.0.rc1 test/fixtures/room.rb
composite_primary_keys-4.1.2 test/fixtures/room.rb
composite_primary_keys-4.1.1 test/fixtures/room.rb
composite_primary_keys-4.0.0 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta9 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta8 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta7 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta6 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta5 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta4 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta3 test/fixtures/room.rb
composite_primary_keys-3.1.10 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta2 test/fixtures/room.rb
composite_primary_keys-4.0.0.beta1 test/fixtures/room.rb
composite_primary_keys-3.1.9 test/fixtures/room.rb
composite_primary_keys-3.1.8 test/fixtures/room.rb
composite_primary_keys-3.1.7 test/fixtures/room.rb