Methods
- A
- S
- T
-
- test_association_not_eq,
- test_chaining_multiple,
- test_not_eq,
- test_not_eq_with_array_parameter,
- test_not_eq_with_preceding_where,
- test_not_eq_with_string_parameter,
- test_not_eq_with_succeeding_where,
- test_not_in,
- test_not_null,
- 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
assert_bound_ast(value, table, type)
Link
setup()
Link
test_association_not_eq()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 44 def test_association_not_eq expected = Comment.arel_table[@name].not_eq('hello') relation = Post.joins(:comments).where.not(comments: {title: 'hello'}) assert_equal(expected.to_sql, relation.where_values.first.to_sql) end
test_chaining_multiple()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 90 def test_chaining_multiple relation = Post.where.not(author_id: [1, 2]).where.not(title: 'ruby on rails') expected = Post.arel_table['author_id'].not_in([1, 2]) assert_equal(expected, relation.where_values[0]) value = relation.where_values[1] bind = relation.bind_values.first assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::NotEqual assert_equal 'ruby on rails', bind.last end
test_not_eq()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 14 def test_not_eq relation = Post.where.not(title: 'hello') assert_equal 1, relation.where_values.length value = relation.where_values.first bind = relation.bind_values.first assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::NotEqual assert_equal 'hello', bind.last end
test_not_eq_with_array_parameter()
Link
test_not_eq_with_preceding_where()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 50 def test_not_eq_with_preceding_where relation = Post.where(title: 'hello').where.not(title: 'world') value = relation.where_values.first bind = relation.bind_values.first assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::Equality assert_equal 'hello', bind.last value = relation.where_values.last bind = relation.bind_values.last assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::NotEqual assert_equal 'world', bind.last end
test_not_eq_with_string_parameter()
Link
test_not_eq_with_succeeding_where()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 64 def test_not_eq_with_succeeding_where relation = Post.where.not(title: 'hello').where(title: 'world') value = relation.where_values.first bind = relation.bind_values.first assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::NotEqual assert_equal 'hello', bind.last value = relation.where_values.last bind = relation.bind_values.last assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::Equality assert_equal 'world', bind.last end
test_not_in()
Link
test_not_null()
Link
test_not_with_nil()
Link
test_rewhere_with_infinite_lower_bound_range()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 167 def test_rewhere_with_infinite_lower_bound_range relation = Post.where(comments_count: -Float::INFINITY..1).rewhere(comments_count: 3..5) assert_equal 1, relation.where_values.size assert_equal Post.where(comments_count: 3..5), relation end
test_rewhere_with_infinite_range()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 174 def test_rewhere_with_infinite_range relation = Post.where(comments_count: -Float::INFINITY..Float::INFINITY).rewhere(comments_count: 3..5) assert_equal 1, relation.where_values.size assert_equal Post.where(comments_count: 3..5), relation end
test_rewhere_with_infinite_upper_bound_range()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 160 def test_rewhere_with_infinite_upper_bound_range relation = Post.where(comments_count: 1..Float::INFINITY).rewhere(comments_count: 3..5) assert_equal 1, relation.where_values.size assert_equal Post.where(comments_count: 3..5), relation end
test_rewhere_with_multiple_overwriting_conditions()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 113 def test_rewhere_with_multiple_overwriting_conditions relation = Post.where(title: 'hello').where(body: 'world').rewhere(title: 'alone', body: 'again') assert_equal 2, relation.where_values.size value = relation.where_values.first bind = relation.bind_values.first assert_bound_ast value, Post.arel_table['title'], Arel::Nodes::Equality assert_equal 'alone', bind.last value = relation.where_values[1] bind = relation.bind_values[1] assert_bound_ast value, Post.arel_table['body'], Arel::Nodes::Equality assert_equal 'again', bind.last end
test_rewhere_with_one_condition()
Link
# File activerecord/test/cases/relation/where_chain_test.rb, line 103 def test_rewhere_with_one_condition relation = Post.where(title: 'hello').where(title: 'world').rewhere(title: 'alone') assert_equal 1, relation.where_values.size value = relation.where_values.first bind = relation.bind_values.first assert_bound_ast value, Post.arel_table[@name], Arel::Nodes::Equality assert_equal 'alone', bind.last end
test_rewhere_with_range()
Link