constrainable 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
|
|
2
2
|
class Bsm::Constrainable::Field::Base
|
3
3
|
DEFAULT_OPERATORS = [:eq, :not_eq, :gt, :gteq, :lt, :lteq, :between].freeze
|
4
4
|
|
5
|
-
|
5
|
+
class_attribute :operators, :defaults, :instance_reader => false, :instance_writer => false
|
6
6
|
self.operators = DEFAULT_OPERATORS.dup
|
7
7
|
self.defaults = [:eq, :not_eq]
|
8
8
|
|
@@ -2,11 +2,6 @@
|
|
2
2
|
module Bsm::Constrainable::Model
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
-
included do
|
6
|
-
class_inheritable_accessor :_constrainable
|
7
|
-
self._constrainable = {}
|
8
|
-
end
|
9
|
-
|
10
5
|
module ClassMethods
|
11
6
|
|
12
7
|
# Constraint definition for a model. Example:
|
@@ -35,5 +30,10 @@ module Bsm::Constrainable::Model
|
|
35
30
|
scoped.constrain(*args)
|
36
31
|
end
|
37
32
|
|
33
|
+
# Store for constrainable definitions
|
34
|
+
def _constrainable
|
35
|
+
@constrainable ||= {}
|
36
|
+
end
|
37
|
+
|
38
38
|
end
|
39
39
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constrainable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dimitrij Denissenko
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-09-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: abstract
|
@@ -37,7 +37,7 @@ dependencies:
|
|
37
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
38
|
none: false
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
hash: 7
|
43
43
|
segments:
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
56
|
-
- -
|
56
|
+
- - ">="
|
57
57
|
- !ruby/object:Gem::Version
|
58
58
|
hash: 7
|
59
59
|
segments:
|