-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ValorWaterAnalytics/DEV-6915c
Dev 6915c
- Loading branch information
Showing
6 changed files
with
70 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,47 @@ | ||
module ActiveRecord | ||
module ConnectionAdapters | ||
class RedshiftColumn < Column #:nodoc: | ||
delegate :oid, :fmod, to: :sql_type_metadata | ||
module Redshift | ||
class Column < ConnectionAdapters::Column #:nodoc: | ||
delegate :oid, :fmod, to: :sql_type_metadata | ||
|
||
def initialize(name, default, sql_type_metadata, null = true, table_name = nil, default_function = nil, encoding = nil, auto_increment = nil) | ||
super name, default, sql_type_metadata, null, default_function | ||
@null = null | ||
@default_function = default_function | ||
@encoding = encoding | ||
@auto_increment = auto_increment | ||
end | ||
def initialize(name, default, sql_type_metadata, null = true, table_name = nil, default_function = nil, encoding = nil, auto_increment = nil, **) | ||
super name, default, sql_type_metadata, null, default_function | ||
@null = null | ||
@default_function = default_function | ||
@encoding = encoding | ||
@auto_increment = auto_increment | ||
end | ||
|
||
def init_with(coder) | ||
super coder | ||
@encoding = coder["encoding"] | ||
@auto_increment = coder["auto_increment"] | ||
end | ||
def init_with(coder) | ||
super coder | ||
@encoding = coder["encoding"] | ||
@auto_increment = coder["auto_increment"] | ||
end | ||
|
||
def encode_with(coder) | ||
super coder | ||
coder["encoding"] = @encoding | ||
coder["auto_increment"] = @auto_increment | ||
end | ||
def encode_with(coder) | ||
super coder | ||
coder["encoding"] = @encoding | ||
coder["auto_increment"] = @auto_increment | ||
end | ||
|
||
def encoding | ||
@encoding | ||
end | ||
def encoding | ||
@encoding | ||
end | ||
|
||
def null | ||
@null | ||
end | ||
def null | ||
@null | ||
end | ||
|
||
def auto_increment | ||
@auto_increment | ||
end | ||
|
||
def auto_increment | ||
@auto_increment | ||
def array | ||
sql_type_metadata.sql_type.end_with?("[]") | ||
end | ||
alias :array? :array | ||
end | ||
end | ||
RedshiftColumn = Redshift::Column | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters