Class: PetRecord

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
BrighterPlanet::Pet, Sniff::Emitter
Defined in:
lib/test_support/pet_record.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BrighterPlanet::Pet

pet_model

Class Method Details

.fallbackObject



26
27
28
# File 'lib/test_support/pet_record.rb', line 26

def fallback
  Species.fallback
end

Instance Method Details

#scope_conditions_for(assoc) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/test_support/pet_record.rb', line 13

def scope_conditions_for(assoc)
  if assoc == :breeds and species
    { :species_id => species.id }
  else
    {}
  end
end

#weight_rangeObject



21
22
23
# File 'lib/test_support/pet_record.rb', line 21

def weight_range
  species.minimum_weight..species.maximum_weight if species
end