Skip to content
Merged
Show file tree
Hide file tree
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 @@ -77,8 +77,8 @@ def detect
associated_models: [through_association.klass.name],
associated_models_type: "join"
)
next
end
next
end

associated_models, associated_models_type =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,25 @@ def test_has_through_associations_when_join_model_incomplete
OUTPUT
end

def test_has_through_associations_with_bad_source
Context.create_table(:users).define_model do
has_many :posts
has_many :comments, through: :posts, source: :non_existent
end

Context.create_table(:posts) do |t|
t.references :users
end.define_model do
has_many :comments
end

Context.create_table(:comments) do |t|
t.references :posts
end.define_model

refute_problems
end

def test_destroy_async_and_foreign_key_exists
Context.create_table(:companies) do
end.define_model do
Expand Down