aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/index_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-10 10:41:24 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-10 10:41:24 -0800
commit522b72fd28b898c914cfbdbc31837e56702f60d5 (patch)
tree4d1322e4a692d3c1c4b4b2519bd80e068c3b6b8b /activerecord/test/cases/migration/index_test.rb
parenta9a12700c72353397cf644073e58a3a1c60c30a2 (diff)
parent3092324ef4e2f6f096adfbcf92597502b3ce91aa (diff)
downloadrails-522b72fd28b898c914cfbdbc31837e56702f60d5.tar.gz
rails-522b72fd28b898c914cfbdbc31837e56702f60d5.tar.bz2
rails-522b72fd28b898c914cfbdbc31837e56702f60d5.zip
Merge branch 'master' into instance_reader
* master: Fix GH #4720. Routing problem with nested namespace and already camelized controller option. make Range#overlaps? accept Range of Time improved test case for partial indices Made schema dumper recognize partial indices' where statements Added where option to add_index to support postgresql partial indices
Diffstat (limited to 'activerecord/test/cases/migration/index_test.rb')
-rw-r--r--activerecord/test/cases/migration/index_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/index_test.rb b/activerecord/test/cases/migration/index_test.rb
index 89cf0f5e93..dd9492924c 100644
--- a/activerecord/test/cases/migration/index_test.rb
+++ b/activerecord/test/cases/migration/index_test.rb
@@ -171,6 +171,15 @@ module ActiveRecord
end
end
+ def test_add_partial_index
+ skip 'only on pg' unless current_adapter?(:PostgreSQLAdapter)
+
+ connection.add_index("testings", "last_name", :where => "first_name = 'john doe'")
+ assert connection.index_exists?("testings", "last_name")
+
+ connection.remove_index("testings", "last_name")
+ assert !connection.index_exists?("testings", "last_name")
+ end
end
end
end