has_constant 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
data/has_constant.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{has_constant}
8
- s.version = "0.2.7"
8
+ s.version = "0.2.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mattbeedle"]
12
- s.date = %q{2010-08-20}
12
+ s.date = %q{2010-10-09}
13
13
  s.description = %q{Allows certain fields to be limited to a set of values}
14
14
  s.email = %q{mattbeedle@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -46,9 +46,9 @@ module HasConstant
46
46
  named_scope :by_constant, lambda { |constant,value| { :where =>
47
47
  { constant.to_sym => eval("#{self.to_s}.#{constant.pluralize}.index(value)") } } }
48
48
  named_scope "#{singular}_is".to_sym, lambda { |values| { :where =>
49
- { singular.to_sym => { '$in' => values.map { |v| self.send(name.to_sym).index(v) } } } } }
49
+ { singular.to_sym => { '$in' => values.to_a.map { |v| self.send(name.to_sym).index(v) } } } } }
50
50
  named_scope "#{singular}_is_not".to_sym, lambda { |values| { :where =>
51
- { singular.to_sym => { '$nin' => values.map { |v| self.send(name.to_sym).index(v) } } } } }
51
+ { singular.to_sym => { '$nin' => values.to_a.map { |v| self.send(name.to_sym).index(v) } } } } }
52
52
  end
53
53
  end
54
54
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_constant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 7
10
- version: 0.2.7
9
+ - 8
10
+ version: 0.2.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - mattbeedle
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-20 00:00:00 +02:00
18
+ date: 2010-10-09 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency