Module: Uuvula::ClassMethods

Defined in:
lib/uuvula.rb

Instance Method Summary collapse

Instance Method Details

#sanitize_sql_hash_for_conditions_with_uuid_support(attrs, table_name = quoted_table_name) ⇒ Object



74
75
76
77
78
79
# File 'lib/uuvula.rb', line 74

def sanitize_sql_hash_for_conditions_with_uuid_support(attrs, table_name = quoted_table_name)
  if @uuid_column_name && attrs.has_key?(@uuid_column_name)
    attrs[@uuid_column_name] = Uuvula.convert_uuid_to_raw(attrs[@uuid_column_name])
  end
  sanitize_sql_hash_for_conditions_without_uuid_support(attrs, table_name)
end

#uuid_column(column_name = :uuid) ⇒ Object



67
68
69
70
71
72
# File 'lib/uuvula.rb', line 67

def uuid_column(column_name = :uuid)
  @uuid_column_name = column_name.to_sym
  Uuvula.define_uuid_reader(self, @uuid_column_name)
  Uuvula.define_uuid_writer(self, @uuid_column_name)
  Uuvula.define_callbacks(self, @uuid_column_name)
end