Methods
- S
- T
-
- test_creates_index,
- test_creates_index_for_existing_table,
- test_creates_index_with_options,
- test_creates_polymorphic_index,
- test_creates_polymorphic_index_for_existing_table,
- test_does_not_create_index,
- test_does_not_create_index_explicit,
- test_does_not_create_index_for_existing_table,
- test_does_not_create_index_for_existing_table_explicit
Attributes
| [R] | connection | |
| [R] | table_name |
Instance Public methods
setup()
Link
test_creates_index()
Link
test_creates_index_for_existing_table()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 62 def test_creates_index_for_existing_table connection.create_table table_name connection.change_table table_name do |t| t.references :foo, :index => true end assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end
test_creates_index_with_options()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 42 def test_creates_index_with_options connection.create_table table_name do |t| t.references :foo, :index => {:name => :index_testings_on_yo_momma} t.references :bar, :index => {:unique => true} end assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_yo_momma) assert connection.index_exists?(table_name, :bar_id, :name => :index_testings_on_bar_id, :unique => true) end
test_creates_polymorphic_index()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 53 def test_creates_polymorphic_index connection.create_table table_name do |t| t.references :foo, :polymorphic => true, :index => true end assert connection.index_exists?(table_name, [:foo_type, :foo_id], name: :index_testings_on_foo_type_and_foo_id) end
test_creates_polymorphic_index_for_existing_table()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 90 def test_creates_polymorphic_index_for_existing_table connection.create_table table_name connection.change_table table_name do |t| t.references :foo, :polymorphic => true, :index => true end assert connection.index_exists?(table_name, [:foo_type, :foo_id], name: :index_testings_on_foo_type_and_foo_id) end
test_does_not_create_index()
Link
test_does_not_create_index_explicit()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 34 def test_does_not_create_index_explicit connection.create_table table_name do |t| t.references :foo, :index => false end assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end
test_does_not_create_index_for_existing_table()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 71 def test_does_not_create_index_for_existing_table connection.create_table table_name connection.change_table table_name do |t| t.references :foo end assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end
test_does_not_create_index_for_existing_table_explicit()
Link
# File activerecord/test/cases/migration/references_index_test.rb, line 80 def test_does_not_create_index_for_existing_table_explicit connection.create_table table_name connection.change_table table_name do |t| t.references :foo, :index => false end assert_not connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_foo_id) end