diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-01 12:57:48 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-07-01 12:58:41 -0300 |
commit | aafa00f4c10a6791e6470112f0f1fbe5f2c3f649 (patch) | |
tree | eba2b5554545cc2a84933f443763a28d9f4c0a8f /activerecord/lib | |
parent | 36938b410e7c7396ee5934246fddc048b898f7ef (diff) | |
download | rails-aafa00f4c10a6791e6470112f0f1fbe5f2c3f649.tar.gz rails-aafa00f4c10a6791e6470112f0f1fbe5f2c3f649.tar.bz2 rails-aafa00f4c10a6791e6470112f0f1fbe5f2c3f649.zip |
Unify the collation API for the database adpters
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/tasks/postgresql_database_tasks.rb | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 507e937c3e..7b263fd62d 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -916,7 +916,7 @@ module ActiveRecord end # Create a new PostgreSQL database. Options include <tt>:owner</tt>, <tt>:template</tt>, - # <tt>:encoding</tt>, <tt>:collate</tt>, <tt>:ctype</tt>, + # <tt>:encoding</tt>, <tt>:collation</tt>, <tt>:ctype</tt>, # <tt>:tablespace</tt>, and <tt>:connection_limit</tt> (note that MySQL uses # <tt>:charset</tt> while PostgreSQL uses <tt>:encoding</tt>). # @@ -934,7 +934,7 @@ module ActiveRecord " TEMPLATE = \"#{value}\"" when :encoding " ENCODING = '#{value}'" - when :collate + when :collation " LC_COLLATE = '#{value}'" when :ctype " LC_CTYPE = '#{value}'" @@ -1064,8 +1064,8 @@ module ActiveRecord end_sql end - # Returns the current database collate. - def collate + # Returns the current database collation. + def collation query(<<-end_sql, 'SCHEMA')[0][0] SELECT pg_database.datcollate FROM pg_database WHERE pg_database.datname LIKE '#{current_database}' end_sql diff --git a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb index 4139460273..ea5cb888fb 100644 --- a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb @@ -30,7 +30,7 @@ module ActiveRecord end def collation - connection.collate + connection.collation end def purge |