plucky 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/plucky/query.rb CHANGED
@@ -13,7 +13,7 @@ module Plucky
13
13
  attr_reader :criteria, :options, :collection
14
14
  def_delegator :criteria, :simple?
15
15
  def_delegator :options, :fields?
16
- def_delegators :to_a, :each
16
+ def_delegators :to_a, :each, :include?
17
17
 
18
18
  def initialize(collection, opts={})
19
19
  @collection, @options, @criteria = collection, OptionsHash.new, CriteriaHash.new
@@ -135,6 +135,11 @@ module Plucky
135
135
  count.zero?
136
136
  end
137
137
 
138
+ def exists?(options={})
139
+ !count(options).zero?
140
+ end
141
+ alias :exist? :exists?
142
+
138
143
  def to_a
139
144
  all
140
145
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Plucky
3
- Version = '0.3.0'
3
+ Version = '0.3.1'
4
4
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Nunemaker
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-15 00:00:00 -04:00
17
+ date: 2010-06-17 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency