custom_fields 2.4.0.rc6 → 2.4.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/custom_fields/types/belongs_to.rb +5 -2
- data/lib/custom_fields/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87df1a5363f364270445953e385d170011067511
|
4
|
+
data.tar.gz: a19f613def98a8e1645d0eeedebda766e2a4871c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73b12b42934e2a35e19e8a4562f4ecfd48b82b39c3e9e775128b9bc4d6a3b421f491725d3c833ee873d30bf967d4dc6234bd9865a988cf10ce2597710c5cc203
|
7
|
+
data.tar.gz: 5bf856dc422e77f8fbffc11133584b85fa5625ed3faa00db61a4169da6877bcafb4bff4b498affb8c0a90429d12c4e59186bef93f3c42f4e76329c6ec26bc19b
|
@@ -11,7 +11,7 @@ module CustomFields
|
|
11
11
|
included do
|
12
12
|
|
13
13
|
def belongs_to_to_recipe
|
14
|
-
{ 'class_name' => self.class_name }
|
14
|
+
{ 'class_name' => self.class_name, 'inverse_of' => self.inverse_of }
|
15
15
|
end
|
16
16
|
|
17
17
|
def belongs_to_is_relationship?
|
@@ -42,7 +42,10 @@ module CustomFields
|
|
42
42
|
|
43
43
|
klass.field position_name, type: ::Integer, default: 0
|
44
44
|
|
45
|
-
|
45
|
+
options = { class_name: rule['class_name'] }
|
46
|
+
options[:inverse_of] = rule['inverse_of'] unless rule['inverse_of'].blank? # an empty String can cause weird behaviours
|
47
|
+
|
48
|
+
klass.belongs_to rule['name'].to_sym, options
|
46
49
|
|
47
50
|
if rule['required']
|
48
51
|
klass.validates_presence_of rule['name'].to_sym
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: custom_fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.0.
|
4
|
+
version: 2.4.0.rc7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|