Class: Settings::DBValue

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/iron/settings/db_value.rb

Overview

Stores a given setting entry’s value in the database

Instance Method Summary collapse

Instance Method Details

#context=(context) ⇒ Object

Set our context



23
24
25
26
27
28
29
30
31
# File 'lib/iron/settings/db_value.rb', line 23

def context=(context)
  if context.is_a?(ActiveRecord::Base)
    self.context_type = context.class.name
    self.context_id = context.id
  else
    self.context_type = context.to_s
    self.context_id = nil
  end
end