Class: Estate
- Inherits:
-
Object
- Object
- Estate
- Includes:
- ActiveModel::ForbiddenAttributesProtection, Concerns::Percentable, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- app/models/estate.rb
Overview
Estate class represents the a domain owned by a producer. A producer can own several wine growing estates.
Instance Method Summary collapse
-
#address ⇒ Object
Personal informations.
- #get_values_for(attr) ⇒ Object
- #set_values_for(attr, values) ⇒ Object
Instance Method Details
#address ⇒ Object
Personal informations
11 |
# File 'app/models/estate.rb', line 11 field :address, type: String, default: "" |
#get_values_for(attr) ⇒ Object
45 46 47 |
# File 'app/models/estate.rb', line 45 def get_values_for(attr) (self.read_attribute(attr) || []).join(',') end |
#set_values_for(attr, values) ⇒ Object
49 50 51 |
# File 'app/models/estate.rb', line 49 def set_values_for(attr, values) self.write_attribute(attr, values.split(',')) end |