Module: Bigamy::ActiveRecord::InstanceMethods

Defined in:
lib/bigamy.rb

Instance Method Summary collapse

Instance Method Details

#export_id_val(i) ⇒ Object



121
122
123
# File 'lib/bigamy.rb', line 121

def export_id_val i
  i
end

#import_id_val(i) ⇒ Object



125
126
127
# File 'lib/bigamy.rb', line 125

def import_id_val i
  BSON::ObjectID.from_string(i)
end

#read_val(c) ⇒ Object



117
118
119
# File 'lib/bigamy.rb', line 117

def read_val c
  read_attribute c
end

#reset_current_relationships(f_key, f_id) ⇒ Object



129
130
131
# File 'lib/bigamy.rb', line 129

def reset_current_relationships f_key, f_id
  collection.update({f_key => f_id}, {f_key => nil}, :multi => true, :upsert => false)
end

#set_value(c, val) ⇒ Object



113
114
115
# File 'lib/bigamy.rb', line 113

def set_value c, val
  self[c] = val
end