Methods
- T
-
- test_or_identity,
- test_or_inside_named_scope,
- test_or_on_loaded_relation,
- test_or_preserves_other_querying_methods,
- test_or_when_grouping,
- test_or_with_bind_params,
- test_or_with_incompatible_relations,
- test_or_with_named_scope,
- test_or_with_non_relation_object_raises_error,
- test_or_with_null_both,
- test_or_with_null_left,
- test_or_with_null_right,
- test_or_with_relation,
- test_or_without_left_where,
- test_or_without_right_where
Instance Public methods
test_or_identity()
Link
test_or_inside_named_scope()
Link
test_or_on_loaded_relation()
Link
test_or_preserves_other_querying_methods()
Link
# File activerecord/test/cases/relation/or_test.rb, line 47 def test_or_preserves_other_querying_methods expected = Post.where('id = 1 or id = 2 or id = 3').order('body asc').to_a partial = Post.order('body asc') assert_equal expected, partial.where('id = 1').or(partial.where(:id => [2, 3])).to_a assert_equal expected, Post.order('body asc').where('id = 1').or(Post.order('body asc').where(:id => [2, 3])).to_a end
test_or_when_grouping()
Link
# File activerecord/test/cases/relation/or_test.rb, line 62 def test_or_when_grouping groups = Post.where('id < 10').group('body').select('body, COUNT(*) AS c') expected = groups.having("COUNT(*) > 1 OR body like 'Such%'").to_a.map {|o| [o.body, o.c] } assert_equal expected, groups.having('COUNT(*) > 1').or(groups.having("body like 'Such%'")).to_a.map {|o| [o.body, o.c] } end
test_or_with_bind_params()
Link
test_or_with_incompatible_relations()
Link
# File activerecord/test/cases/relation/or_test.rb, line 54 def test_or_with_incompatible_relations error = assert_raises ArgumentError do Post.order('body asc').where('id = 1').or(Post.order('id desc').where(:id => [2, 3])).to_a end assert_equal "Relation passed to #or must be structurally compatible. Incompatible values: [:order]", error.message end
test_or_with_named_scope()
Link
test_or_with_non_relation_object_raises_error()
Link
test_or_with_null_both()
Link
test_or_with_null_left()
Link
test_or_with_null_right()
Link
test_or_with_relation()
Link
test_or_without_left_where()
Link