Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #6073, #6383 - Postgres added tsvector type, and fixed money_precision= NoMethodError #197

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def simplified_type(field_type)
# UUID type
when 'uuid'
:string
# TSVector type
when 'tsvector'
:tsvector
# Small and big integer types
when /^(?:small|big)int$/
:integer
Expand Down Expand Up @@ -207,7 +210,8 @@ class PostgreSQLAdapter < AbstractAdapter
:date => { :name => "date" },
:binary => { :name => "bytea" },
:boolean => { :name => "boolean" },
:xml => { :name => "xml" }
:xml => { :name => "xml" },
:tsvector => { :name => "tsvector" }
}

# Returns 'PostgreSQL' as adapter name for identification purposes.
Expand Down Expand Up @@ -935,7 +939,7 @@ def connect
# Money type has a fixed precision of 10 in PostgreSQL 8.2 and below, and as of
# PostgreSQL 8.3 it has a fixed precision of 19. PostgreSQLColumn.extract_precision
# should know about this but can't detect it there, so deal with it here.
PostgreSQLColumn.money_precision = (postgresql_version >= 80300) ? 19 : 10
ActiveRecord::ConnectionAdapters::PostgreSQLColumn.money_precision = (postgresql_version >= 80300) ? 19 : 10

configure_connection
end
Expand Down