backframe 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41c865ad3f5adda1a6d1799258e50b796f6639f8
4
- data.tar.gz: 957fa7a9d3177940999662ef37925cc8a310605a
3
+ metadata.gz: 21ef40afe4b8a9b5aea34dae0d739625dd5cbec4
4
+ data.tar.gz: e1bbbd7efa50b76af0585849e09a6764a392f93b
5
5
  SHA512:
6
- metadata.gz: 1ffb061c4285eba6192b2a6fd163700515a9b072e223c9922f09b59d9c9186a6790ebdcecaf41dd5317862a500b6482bc6558fe7ca0e66c04c1249f75877ce42
7
- data.tar.gz: 1975fecd01a6503f2d9745e96a35bc120eb5299ab95daf068ab791e1f3aa4cb2ad0d873dde40ca48ed55146271c426d0c554543bfed07765e0b0531421b770fa
6
+ metadata.gz: 4365b6368f2fc9f7c932b13b26269de4c2a569966a3d991968a854d97b86f7ba070071ac7887e254fcbbdbc62c39f734333090e09ff0649fd0970654f211721d
7
+ data.tar.gz: 498c1605c001d044ff4165bebe2d5ee261ddfd33f135f0318508533967924de7133fbc9646a1e5efcb2f0eaba80e04ad9bcb6f1e1943546cfb5c3c95e813a619
@@ -39,21 +39,19 @@ module Backframe
39
39
 
40
40
  class_eval <<-EOV
41
41
  scope :#{field}_is, -> (*options) { where('#{field} IN (?)', (options.is_a?(Array) ? options : [options])) }
42
+
43
+ def #{field}_is?(*options)
44
+ (options.is_a?(Array) ? options : [options])include?(self.#{field})
45
+ end
42
46
  EOV
43
47
 
44
48
  class_eval <<-EOV
45
49
  scope :#{field}_not, -> (*options) { where('#{field} NOT IN (?)', (options.is_a?(Array) ? options : [options])) }
46
- EOV
47
50
 
48
- arguments[:in].each do |option|
49
- class_eval <<-EOV
50
- scope :#{field}_#{option}, -> { #{field}_is(option) }
51
-
52
- def #{field}_#{option}?
53
- self.#{field} == '#{option}'
54
- end
55
- EOV
56
- end
51
+ def #{field}_not?(*options)
52
+ !(options.is_a?(Array) ? options : [options])include?(self.#{field})
53
+ end
54
+ EOV
57
55
 
58
56
  end
59
57
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backframe
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backframe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kops