Sha256: 4b3066f1468bb224cd8350ce5d0e39d38567c22ea3c24ec733ecafc82014c77f
Contents?: true
Size: 492 Bytes
Versions: 22
Compression:
Stored size: 492 Bytes
Contents
class Person < ActiveRecord::Base has_many :pets has_one :wallet accepts_nested_attributes_for :pets accepts_nested_attributes_for :wallet def oldest_pet pets.first :order => "age DESC" end def location_sentence "Hi. I'm currently in #{ current_location }" end def has_pets pets.size > 0 end def pets_ages_hash returning pets_hash = {} do pets.each do |pet| pets_hash[pet.name] = pet.age end end end apiable end
Version data entries
22 entries across 22 versions & 4 rubygems