Sha256: 1330cb5cb81bd3f030048ae08cdd5e9fc3f63df0194be13db11e5b9dc1c43396
Contents?: true
Size: 688 Bytes
Versions: 1
Compression:
Stored size: 688 Bytes
Contents
class Address include Mongoid::Document field :address_type field :number, :type => Integer field :street field :city field :state field :post_code field :parent_title field :services, :type => Array key :street embed_many :locations embedded_in :addressable, :inverse_of => :addresses do def extension "Testing" end def doctor? title == "Dr" end end named_scope :rodeo, where(:street => "Rodeo Dr") def set_parent=(set = false) self.parent_title = addressable.title if set end class << self def california where(:state => "CA") end def homes where(:address_type => "Home") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid-2.0.0.alpha | spec/models/address.rb |