From f79d55a4cca155171c6d16c3c07834ba43d572c2 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 7 Aug 2016 00:41:24 +0900 Subject: `where` by `array|range` attribute with array or range value Currently predicate builder cannot build a predicate for `array|range` attribute. This commit fixes the issue. Related #25671. --- activerecord/test/cases/adapters/postgresql/range_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activerecord/test/cases/adapters/postgresql/range_test.rb') diff --git a/activerecord/test/cases/adapters/postgresql/range_test.rb b/activerecord/test/cases/adapters/postgresql/range_test.rb index 3f819f7bd5..f411884dfd 100644 --- a/activerecord/test/cases/adapters/postgresql/range_test.rb +++ b/activerecord/test/cases/adapters/postgresql/range_test.rb @@ -282,6 +282,12 @@ _SQL assert_raises(ArgumentError) { PostgresqlRange.create!(tstz_range: "(''2010-01-01 14:30:00+05'', ''2011-01-01 14:30:00-03'']") } end + def test_where_by_attribute_with_range + range = 1..100 + record = PostgresqlRange.create!(int4_range: range) + assert_equal record, PostgresqlRange.where(int4_range: range).take + end + def test_update_all_with_ranges PostgresqlRange.create! -- cgit v1.2.3