Methods
- S
- T
-
- test_association_not_eq,
- test_chaining_multiple,
- test_not_eq_with_preceding_where,
- test_not_eq_with_succeeding_where,
- test_not_inverts_where_clause,
- test_not_with_nil,
- test_rewhere_with_infinite_lower_bound_range,
- test_rewhere_with_infinite_range,
- test_rewhere_with_infinite_upper_bound_range,
- test_rewhere_with_multiple_overwriting_conditions,
- test_rewhere_with_one_condition,
- test_rewhere_with_one_overwriting_condition_and_one_unrelated,
- test_rewhere_with_range
Instance Public methods
setup()
Link
test_association_not_eq()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 27 def test_association_not_eq expected = Arel::Nodes::Grouping.new(Comment.arel_table[@name].not_eq(Arel::Nodes::BindParam.new)) relation = Post.joins(:comments).where.not(comments: {title: 'hello'}) assert_equal(expected.to_sql, relation.where_clause.ast.to_sql) end
test_chaining_multiple()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 51 def test_chaining_multiple relation = Post.where.not(author_id: [1, 2]).where.not(title: 'ruby on rails') expected_where_clause = Post.where(author_id: [1, 2]).where_clause.invert + Post.where(title: 'ruby on rails').where_clause.invert assert_equal expected_where_clause, relation.where_clause end
test_not_eq_with_preceding_where()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 33 def test_not_eq_with_preceding_where relation = Post.where(title: 'hello').where.not(title: 'world') expected_where_clause = Post.where(title: 'hello').where_clause + Post.where(title: 'world').where_clause.invert assert_equal expected_where_clause, relation.where_clause end
test_not_eq_with_succeeding_where()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 42 def test_not_eq_with_succeeding_where relation = Post.where.not(title: 'hello').where(title: 'world') expected_where_clause = Post.where(title: 'hello').where_clause.invert + Post.where(title: 'world').where_clause assert_equal expected_where_clause, relation.where_clause end
test_not_inverts_where_clause()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 14 def test_not_inverts_where_clause relation = Post.where.not(title: 'hello') expected_where_clause = Post.where(title: 'hello').where_clause.invert assert_equal expected_where_clause, relation.where_clause end
test_not_with_nil()
Link
test_rewhere_with_infinite_lower_bound_range()
Link
test_rewhere_with_infinite_range()
Link
test_rewhere_with_infinite_upper_bound_range()
Link
test_rewhere_with_multiple_overwriting_conditions()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 67 def test_rewhere_with_multiple_overwriting_conditions relation = Post.where(title: 'hello').where(body: 'world').rewhere(title: 'alone', body: 'again') expected = Post.where(title: 'alone', body: 'again') assert_equal expected.where_clause, relation.where_clause end
test_rewhere_with_one_condition()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 60 def test_rewhere_with_one_condition relation = Post.where(title: 'hello').where(title: 'world').rewhere(title: 'alone') expected = Post.where(title: 'alone') assert_equal expected.where_clause, relation.where_clause end