diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 16:53:49 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-03-16 16:53:49 -0700 |
commit | aa5c9a19826c84bbb9c9f75f8d1a4b04b874780c (patch) | |
tree | c5a6720db91fed575f9fbd0b8de08de651def91c /spec/active_relation/unit/primitives/attribute_spec.rb | |
parent | 07f7f752fecb56316456f144c121e471fd0d0847 (diff) | |
download | rails-aa5c9a19826c84bbb9c9f75f8d1a4b04b874780c.tar.gz rails-aa5c9a19826c84bbb9c9f75f8d1a4b04b874780c.tar.bz2 rails-aa5c9a19826c84bbb9c9f75f8d1a4b04b874780c.zip |
added support for `attribute IN ...` and `attribute BETWEEN ...`
- IN and BETWEEN are chosen depending on the type of the second operand
- ranges (1..2), arrays ([1,2,3]), and relations ("SELECT * ...") are all supported
Diffstat (limited to 'spec/active_relation/unit/primitives/attribute_spec.rb')
-rw-r--r-- | spec/active_relation/unit/primitives/attribute_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/active_relation/unit/primitives/attribute_spec.rb b/spec/active_relation/unit/primitives/attribute_spec.rb index a0f6cde8f7..2806d26330 100644 --- a/spec/active_relation/unit/primitives/attribute_spec.rb +++ b/spec/active_relation/unit/primitives/attribute_spec.rb @@ -130,6 +130,12 @@ module ActiveRelation @attribute.matches(/.*/).should == Match.new(@attribute, /.*/) end end + + describe '#in' do + it "manufactures an in predicate" do + @attribute.in(1..30).should == In.new(@attribute, 1..30) + end + end end describe Attribute::Expressions do |