active_form_objects 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dsl/relations.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99d26a7f22a07026033f6bb80606ef503aee1449010469f8652d9b10bd62812
|
4
|
+
data.tar.gz: 0f7fd36f0be826e6ffcdf8a1b45a54018ab83b1f9aebcb3ff723bb9d21fdd5f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec428c4fccec9acd974d5af6cbbb6e4dcd99f26eae2f32260e73d27e8446abef87c835f4fcae31ef25825421ef26f7ec7de272bd36bc428f086165ce97082cf9
|
7
|
+
data.tar.gz: c5423033eb5dc15c6315efeb1d04cf3d14827d76710969e20133de6669fe598237c7d1af61823cf97d931d89d094bcc3a9a285dc130e838982208e0babebe86a
|
data/lib/dsl/relations.rb
CHANGED
@@ -26,7 +26,12 @@ module Dsl
|
|
26
26
|
# relations(:entity, :user)
|
27
27
|
#
|
28
28
|
def relations(*params)
|
29
|
-
|
29
|
+
options = {}
|
30
|
+
if params.last.is_a?(Hash)
|
31
|
+
options = params.last
|
32
|
+
params.pop
|
33
|
+
end
|
34
|
+
validates(*params, relation: true) unless options[:skip_validations]
|
30
35
|
|
31
36
|
params.each do |param|
|
32
37
|
relation_key = "#{param}_id".to_sym
|