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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b3514e4a593d1570561ca8b1357bd798ccdc743
4
- data.tar.gz: c8c00c05f0316a674fa9f0bff727590792ae49b2
3
+ metadata.gz: becaec3897b25d20e6409644dd9dc65a147f72a8
4
+ data.tar.gz: 077f06792bea9da2b6f522910b166eeb4c2fbc70
5
5
  SHA512:
6
- metadata.gz: b2862d3b3d5e7e9842ad82f4690a7b27c0467a9a25b614d920ef115620a9c6cffe3c79d07a6d0dbb8ba4f496d48a48fd1ca677f96f6b6fbb26e0b1a24886bfcb
7
- data.tar.gz: d1ba692ef78771f7c12f911da72e9c6e454fb8a670ed59b69ced5bec5db082de4d93f4da784ae2796e446e17b32437af82699ab5fbfd12bf944c0b6c58c6f461
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 = req_params.is_a?(OpenStruct) ? req_params.to_hash : DeepOpenStruct.new(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
@@ -1,3 +1,3 @@
1
1
  module Conjoin
2
- VERSION = "0.0.70"
2
+ VERSION = "0.0.71"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.70
4
+ version: 0.0.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj