Class: Estate

Inherits:
Object
  • Object
show all
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

Instance Method Details

#addressObject

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