mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test case for unscope
with unknown column
This commit is contained in:
parent
df2765ac03
commit
15da1fb35b
1 changed files with 11 additions and 0 deletions
|
@ -1941,6 +1941,17 @@ class RelationTest < ActiveRecord::TestCase
|
|||
assert_equal p2.first.comments, comments
|
||||
end
|
||||
|
||||
def test_unscope_with_unknown_column
|
||||
comment = comments(:greetings)
|
||||
comment.update!(comments: 1)
|
||||
|
||||
comments = Comment.where(comments: 1).unscope(where: :unknown_column)
|
||||
assert_equal [comment], comments
|
||||
|
||||
comments = Comment.where(comments: 1).unscope(where: { comments: :unknown_column })
|
||||
assert_equal [comment], comments
|
||||
end
|
||||
|
||||
def test_unscope_specific_where_value
|
||||
posts = Post.where(title: "Welcome to the weblog", body: "Such a lovely day")
|
||||
|
||||
|
|
Loading…
Reference in a new issue