Class: EasyKeyValue
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- EasyKeyValue
- Defined in:
- lib/easy_key_value/easy_key_value.rb
Class Method Summary collapse
-
.add_key(object, key, value) ⇒ Object
Adds a key with a given value for a given object.
Class Method Details
.add_key(object, key, value) ⇒ Object
Adds a key with a given value for a given object
13 14 15 16 17 18 19 20 |
# File 'lib/easy_key_value/easy_key_value.rb', line 13 def self.add_key(object, key, value) ekv = EasyKeyValue.new ekv.ekv_id = object.id ekv.ekv_type = object.class.to_s ekv.key = key ekv.value = value ekv.save end |