conjoin 0.0.70 → 0.0.71
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/conjoin/active_record.rb +3 -1
- data/lib/conjoin/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: becaec3897b25d20e6409644dd9dc65a147f72a8
|
4
|
+
data.tar.gz: 077f06792bea9da2b6f522910b166eeb4c2fbc70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d524b136af087bc3f7013bf82e15a5717fbfcfba1ef9ee7b8c481f9bf23b9f22f61656bd5909ea143f92fc8ed0c077582e8b328da4467f2b30a6b94a6d1c6b1
|
7
|
+
data.tar.gz: 43f15a04692b313606402e6b9f63e379c65fcd7e34d457065d829725b08ca3d85c09e2c21806172aadbc83f3fc5519cc278ac89d01d7b3b641cda2dc4bf396dd
|
@@ -73,7 +73,7 @@ module Conjoin
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def validates req_params, opts = {}
|
76
|
-
req_params
|
76
|
+
req_params = req_params.to_h
|
77
77
|
@req_params = req_params
|
78
78
|
|
79
79
|
if as = opts.delete(:as)
|
@@ -129,6 +129,7 @@ module Conjoin
|
|
129
129
|
return unless current_params
|
130
130
|
# loop through associated records
|
131
131
|
current_params.each do |name, value|
|
132
|
+
name = name.to_s
|
132
133
|
if name.end_with?("_attributes")
|
133
134
|
associated_name = name.gsub(/_attributes$/, '')
|
134
135
|
associated_model = model.try associated_name
|
@@ -141,6 +142,7 @@ module Conjoin
|
|
141
142
|
elsif associated_model.kind_of? ActiveRecord::Associations::CollectionProxy
|
142
143
|
new_current_params = current_params[name]
|
143
144
|
associated_model.each_with_index do |current_model, i|
|
145
|
+
new_current_params ||= []
|
144
146
|
add_creator_and_updater_for current_model, current_user, new_current_params[i]
|
145
147
|
end
|
146
148
|
end
|
data/lib/conjoin/version.rb
CHANGED