Module: Traits::Attribute::Naming

Included in:
Traits::Attribute
Defined in:
lib/traits/attribute/naming.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



7
8
9
# File 'lib/traits/attribute/naming.rb', line 7

def name
  @name ||= column_definition.name.to_sym
end

#quoted_nameObject



11
12
13
# File 'lib/traits/attribute/naming.rb', line 11

def quoted_name
  @quoted_name ||= active_record.connection.quote_column_name(name)
end

#to_hashObject



15
16
17
18
19
20
# File 'lib/traits/attribute/naming.rb', line 15

def to_hash
  super.merge!(
    name:        name,
    quoted_name: quoted_name
  )
end