Class: Spina::Account
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Spina::Account
- Includes:
- Partable
- Defined in:
- app/models/spina/account.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Partable
Class Method Details
.serialized_attr_accessor(*args) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/models/spina/account.rb', line 25 def self.serialized_attr_accessor(*args) args.each do |method_name| eval " def #{method_name} (self.preferences || {})[:#{method_name}] end def #{method_name}=(value) self.preferences ||= {} self.preferences[:#{method_name}] = value end " end end |
Instance Method Details
#content(layout_part) ⇒ Object
20 21 22 23 |
# File 'app/models/spina/account.rb', line 20 def content(layout_part) layout_part = layout_parts.where(name: layout_part).first layout_part.try(:content) end |
#to_s ⇒ Object
16 17 18 |
# File 'app/models/spina/account.rb', line 16 def to_s name end |