Class: ActiveRecord::ConnectionAdapters::SQLServerColumn
- Defined in:
- lib/connection_adapters/sqlserver_adapter.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#default_specified ⇒ Object
Returns the value of attribute default_specified.
-
#identity ⇒ Object
(also: #generated?)
readonly
Returns the value of attribute identity.
-
#is_special ⇒ Object
readonly
Returns the value of attribute is_special.
Instance Method Summary collapse
- #default_specified? ⇒ Boolean
-
#initialize(name, default, sql_type = nil, identity = false, null = true) ⇒ SQLServerColumn
constructor
Borrowed verbatim from standard Rails sqlserver_adapter.
Constructor Details
#initialize(name, default, sql_type = nil, identity = false, null = true) ⇒ SQLServerColumn
Borrowed verbatim from standard Rails sqlserver_adapter. Had to re-implement a bit of functionality here to avoid a dependency on SQLServerColumn.identity accessor
Once the ActiveRecord gem includes the latest version of sqlserver_adapter, I’ll be to remove this code
20 21 22 23 24 25 26 27 |
# File 'lib/connection_adapters/sqlserver_adapter.rb', line 20 def initialize(name, default, sql_type = nil, identity = false, null = true) if !(default.nil? || default.blank?) then @default_specified = true end super(name, default, sql_type, null) @identity = identity @is_special = sql_type =~ /text|ntext|image/i # SQL Server only supports limits on *char and float types @limit = nil unless @type == :float or @type == :string end |
Instance Attribute Details
#default_specified ⇒ Object
Returns the value of attribute default_specified.
7 8 9 |
# File 'lib/connection_adapters/sqlserver_adapter.rb', line 7 def default_specified @default_specified end |
#identity ⇒ Object (readonly) Also known as: generated?
Returns the value of attribute identity.
6 7 8 |
# File 'lib/connection_adapters/sqlserver_adapter.rb', line 6 def identity @identity end |
#is_special ⇒ Object (readonly)
Returns the value of attribute is_special.
6 7 8 |
# File 'lib/connection_adapters/sqlserver_adapter.rb', line 6 def is_special @is_special end |
Instance Method Details
#default_specified? ⇒ Boolean
10 11 12 |
# File 'lib/connection_adapters/sqlserver_adapter.rb', line 10 def default_specified? @default_specified end |