Class: ActiveRecord::ConnectionAdapters::SQLServer::Column
- Inherits:
 - 
      ConnectionAdapters::Column
      
        
- Object
 - ConnectionAdapters::Column
 - ActiveRecord::ConnectionAdapters::SQLServer::Column
 
 
- Defined in:
 - lib/active_record/connection_adapters/sqlserver_column.rb
 
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
 - #case_sensitive? ⇒ Boolean
 - #encode_with(coder) ⇒ Object
 - #hash ⇒ Object
 - #init_with(coder) ⇒ Object
 - 
  
    
      #initialize(is_identity: nil, is_primary: nil, table_name: nil, ordinal_position: nil)  ⇒ Column 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Column.
 - #is_identity? ⇒ Boolean
 - #is_primary? ⇒ Boolean
 - #is_utf8? ⇒ Boolean
 
Constructor Details
#initialize(is_identity: nil, is_primary: nil, table_name: nil, ordinal_position: nil) ⇒ Column
Returns a new instance of Column.
      9 10 11 12 13 14 15  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 9 def initialize(*, is_identity: nil, is_primary: nil, table_name: nil, ordinal_position: nil, **) super @is_identity = is_identity @is_primary = is_primary @table_name = table_name @ordinal_position = ordinal_position end  | 
  
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
      49 50 51 52 53 54 55 56  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 49 def ==(other) other.is_a?(Column) && super && is_identity? == other.is_identity? && is_primary? == other.is_primary? && table_name == other.table_name && ordinal_position == other.ordinal_position end  | 
  
#case_sensitive? ⇒ Boolean
      29 30 31  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 29 def case_sensitive? collation && collation.match(/_CS/) end  | 
  
#encode_with(coder) ⇒ Object
      41 42 43 44 45 46 47  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 41 def encode_with(coder) coder["is_identity"] = @is_identity coder["is_primary"] = @is_primary coder["table_name"] = @table_name coder["ordinal_position"] = @ordinal_position super end  | 
  
#hash ⇒ Object
      59 60 61 62 63 64 65 66  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 59 def hash Column.hash ^ super.hash ^ is_identity?.hash ^ is_primary?.hash ^ table_name.hash ^ ordinal_position.hash end  | 
  
#init_with(coder) ⇒ Object
      33 34 35 36 37 38 39  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 33 def init_with(coder) @is_identity = coder["is_identity"] @is_primary = coder["is_primary"] @table_name = coder["table_name"] @ordinal_position = coder["ordinal_position"] super end  | 
  
#is_identity? ⇒ Boolean
      17 18 19  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 17 def is_identity? is_identity end  | 
  
#is_primary? ⇒ Boolean
      21 22 23  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 21 def is_primary? is_primary end  | 
  
#is_utf8? ⇒ Boolean
      25 26 27  | 
    
      # File 'lib/active_record/connection_adapters/sqlserver_column.rb', line 25 def is_utf8? sql_type =~ /nvarchar|ntext|nchar/i end  |