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 +4 -4
- data/lib/backframe/activerecord/acts_as_enum.rb +8 -10
- data/lib/backframe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ef40afe4b8a9b5aea34dae0d739625dd5cbec4
|
4
|
+
data.tar.gz: e1bbbd7efa50b76af0585849e09a6764a392f93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
49
|
-
|
50
|
-
|
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
|
|
data/lib/backframe/version.rb
CHANGED