Class: ProfileFieldTypes::Employment

Inherits:
ProfileField show all
Defined in:
app/models/profile_field_types/employment.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ProfileField

#children_count, #delete_cache, #display_html, #key, #orig_profileable, possible_types, #profileable, #save, #underscored_type, #value

Methods inherited from ActiveRecord::Base

#readonly?

Class Method Details

.model_nameObject



4
# File 'app/models/profile_field_types/employment.rb', line 4

def self.model_name; ProfileField.model_name; end

Instance Method Details

#fromObject



14
15
16
# File 'app/models/profile_field_types/employment.rb', line 14

def from
  get_field(:from).to_date if get_field(:from)
end

#labelObject

If the employment instance has no label, just say ‘Employment’.



10
11
12
# File 'app/models/profile_field_types/employment.rb', line 10

def label
  super || I18n.translate( :employment, default: "Employment" ) 
end

#toObject



18
19
20
# File 'app/models/profile_field_types/employment.rb', line 18

def to
  get_field(:to).to_date if get_field(:to)
end