Module: RedhillonrailsCore::ActiveRecord::ConnectionAdapters::Column

Defined in:
lib/redhillonrails_core/active_record/connection_adapters/column.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#case_sensitiveObject Also known as: case_sensitive?

Returns the value of attribute case_sensitive.



6
7
8
# File 'lib/redhillonrails_core/active_record/connection_adapters/column.rb', line 6

def case_sensitive
  @case_sensitive
end

#unique_scopeObject

Returns the value of attribute unique_scope.



5
6
7
# File 'lib/redhillonrails_core/active_record/connection_adapters/column.rb', line 5

def unique_scope
  @unique_scope
end

Instance Method Details

#required_onObject



13
14
15
16
17
18
19
20
21
# File 'lib/redhillonrails_core/active_record/connection_adapters/column.rb', line 13

def required_on
  if null
    nil
  elsif default.nil?
    :save
  else
    :update
  end
end

#unique?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/redhillonrails_core/active_record/connection_adapters/column.rb', line 9

def unique?
  !unique_scope.nil?
end