Class: ActiveRecord::ConnectionAdapters::MySQL::Column
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::MySQL::Column
show all
- Defined in:
- lib/active_record/connection_adapters/mysql/column.rb
Overview
Instance Attribute Summary
Attributes inherited from Column
#collation, #comment, #default, #default_function, #name, #null, #sql_type_metadata, #table_name
Instance Method Summary
collapse
Methods inherited from Column
#==, #bigint?, #hash, #human_name
Constructor Details
#initialize ⇒ Column
Returns a new instance of Column.
7
8
9
10
11
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 7
def initialize(*)
super
assert_valid_default
end
|
Instance Method Details
#auto_increment? ⇒ Boolean
30
31
32
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 30
def auto_increment?
== 'auto_increment'
end
|
#blob_or_text_column? ⇒ Boolean
18
19
20
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 18
def blob_or_text_column?
/\A(?:tiny|medium|long)?blob\b/ === sql_type || type == :text
end
|
#case_sensitive? ⇒ Boolean
26
27
28
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 26
def case_sensitive?
collation && collation !~ /_ci\z/
end
|
#has_default? ⇒ Boolean
13
14
15
16
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 13
def has_default?
return false if blob_or_text_column? super
end
|
#unsigned? ⇒ Boolean
22
23
24
|
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 22
def unsigned?
/\bunsigned\z/ === sql_type
end
|