mongo_scope 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -39,7 +39,7 @@ From the examples dir
39
39
  puts coll.scope_eq(:first_name => /^L/).scope_eq(:age => 27).find.count # 1
40
40
 
41
41
  # the raw scope method (this is wrapped by the helper methods)
42
- puts coll.scope(:op => '$in', :field => :first_name, :val => ['Mike','Lowell']).find.count # 2
42
+ puts coll.raw_scope(:op => '$in', :field => :first_name, :val => ['Mike','Lowell']).find.count # 2
43
43
 
44
44
  == Copyright
45
45
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -24,4 +24,4 @@ puts coll.scope_gt(:age => 27).find.count # 1
24
24
  puts coll.scope_eq(:first_name => /^L/).scope_eq(:age => 27).find.count # 1
25
25
 
26
26
  # the raw scope method (this is wrapped by the helper methods)
27
- puts coll.scope(:op => '$in', :field => :first_name, :val => ['Mike','Lowell']).find.count # 2
27
+ puts coll.raw_scope(:op => '$in', :field => :first_name, :val => ['Mike','Lowell']).find.count # 2
data/lib/mongo_scope.rb CHANGED
@@ -3,7 +3,7 @@ require File.join(File.dirname(__FILE__),'mongo_scope','util')
3
3
 
4
4
  module MongoScope
5
5
  module ScopeMethods
6
- def scope(ops)
6
+ def raw_scope(ops)
7
7
  ScopedCollection.new(ops,self)
8
8
  end
9
9
  def scope_eq(ops)
@@ -12,7 +12,7 @@ module MongoScope
12
12
  end
13
13
  %w(in nin gt lt gte lte ne mod all size exists).each do |op|
14
14
  define_method("scope_#{op}") do |ops|
15
- scope(:op => "$#{op}", :field => ops.keys.first, :val => ops.values.first)
15
+ raw_scope(:op => "$#{op}", :field => ops.keys.first, :val => ops.values.first)
16
16
  end
17
17
  end
18
18
  end
@@ -26,7 +26,7 @@ describe "MongoScope" do
26
26
  @coll.save({:first_name => 'Lou', :age => 27})
27
27
  end
28
28
  it 'scope method' do
29
- @coll.scope(:op => '$in', :field => :first_name, :val => ['Mike','Dave']).find.count.should == 1
29
+ @coll.raw_scope(:op => '$in', :field => :first_name, :val => ['Mike','Dave']).find.count.should == 1
30
30
  end
31
31
  it 'helper method - in' do
32
32
  @coll.scope_in(:first_name => ['Mike','Dave']).find.count.should == 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo_scope
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Harris