Class: Edgar::Address
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Edgar::Address
- Defined in:
- app/models/edgar/address.rb
Class Method Summary (collapse)
-
+ (Object) intern(hash)
return persisted address record.
Instance Method Summary (collapse)
Class Method Details
+ (Object) intern(hash)
return persisted address record.
This is similar to create/update. If already exist, just returns the one.
12 13 14 15 16 17 18 |
# File 'app/models/edgar/address.rb', line 12 def self.intern(hash) if (rec = where(hash).first) rec else create!(hash) end end |
Instance Method Details
- (Object) name
20 21 22 |
# File 'app/models/edgar/address.rb', line 20 def name [zip, prefecture, city, town, other, other2, other3, other4].join(' ') end |