aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/view_test.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-04-12 22:39:15 +0930
committerMatthew Draper <matthew@trebex.net>2017-04-12 23:38:57 +0930
commit7384771dd0652ec4d82c0ad16522a87102316aee (patch)
treebf2fbbe92b154f4cca7a2a70abd6eb2d6d496e5e /activerecord/test/cases/view_test.rb
parent2b4583f2a2ef94bc8c046e36e2b62ec642bbfb41 (diff)
downloadrails-7384771dd0652ec4d82c0ad16522a87102316aee.tar.gz
rails-7384771dd0652ec4d82c0ad16522a87102316aee.tar.bz2
rails-7384771dd0652ec4d82c0ad16522a87102316aee.zip
Use a query that's compatible with PostgreSQL 9.2
Also, explicitly apply the order: generate_subscripts is unlikely to start returning values out of order, but we should still be clear about what we want.
Diffstat (limited to 'activerecord/test/cases/view_test.rb')
-rw-r--r--activerecord/test/cases/view_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/test/cases/view_test.rb b/activerecord/test/cases/view_test.rb
index 07288568e8..1d21a2454f 100644
--- a/activerecord/test/cases/view_test.rb
+++ b/activerecord/test/cases/view_test.rb
@@ -154,7 +154,9 @@ if ActiveRecord::Base.connection.supports_views?
end
# sqlite dose not support CREATE, INSERT, and DELETE for VIEW
- if current_adapter?(:Mysql2Adapter, :PostgreSQLAdapter, :SQLServerAdapter)
+ if current_adapter?(:Mysql2Adapter, :SQLServerAdapter) ||
+ current_adapter?(:PostgreSQLAdapter) && ActiveRecord::Base.connection.postgresql_version >= 90300
+
class UpdateableViewTest < ActiveRecord::TestCase
self.use_transactional_tests = false
fixtures :books