Class: ShortText

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/short_text.rb

Instance Method Summary collapse

Instance Method Details

#entity_valueObject



5
6
7
# File 'app/models/short_text.rb', line 5

def entity_value
  self.value
end

#entity_value=(value) ⇒ Object



9
10
11
12
# File 'app/models/short_text.rb', line 9

def entity_value=(value)
  self.value = value
  self.save
end

#update_settingObject



14
15
16
17
18
19
20
21
22
# File 'app/models/short_text.rb', line 14

def update_setting
  # TODO try to move this code to the setting class and improve the design
  parent_setting = AdminSetting.find_by_entity_id_and_entity_type(self.id,'ShortText')
  if parent_setting
    parent_setting.name = self.name
    parent_setting.display_name = self.name.humanize
    parent_setting.save
  end
end