Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use alias_attribute to alias an association #48783

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions activerecord/test/cases/relation/where_test.rb
Expand Up @@ -34,10 +34,6 @@ def test_where_with_through_association
assert_equal [authors(:bob)], Author.joins(:categories).where(categories: categories(:technology))
end

def test_where_with_aliased_association
assert_equal [comments(:does_it_hurt)], Comment.where(entry: posts(:thinking))
end

def test_type_cast_is_not_evaluated_at_relation_build_time
posts = nil

Expand Down
2 changes: 0 additions & 2 deletions activerecord/test/models/comment.rb
Expand Up @@ -28,8 +28,6 @@ class Comment < ActiveRecord::Base
has_many :children, class_name: "Comment", inverse_of: :parent
belongs_to :parent, class_name: "Comment", counter_cache: :children_count, inverse_of: :children

alias_attribute :entry, :post

enum label: [:default, :child]

class ::OopsError < RuntimeError; end
Expand Down