conjoin 0.0.72 → 0.0.73

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: 6ce076efde1f80dc8768b7f84f884cf4b6c6c1d7
4
- data.tar.gz: 1b8a32ac5cb2b2cc431e5ba3aac90057abc6b45a
3
+ metadata.gz: b92d5e4f6afdd4e67f7d35866a636ac26fd947e2
4
+ data.tar.gz: 0c108cffd19cbd47743ae4261a41a3098d88af11
5
5
  SHA512:
6
- metadata.gz: 56a5928a355b0c68775f7d56fdb5d82dc4cc0da25d5a9e150436e407f42fe957da3af0fae4c79afbd4aedcb1e39c50819526a66b154c8765c76ad27d949044d5
7
- data.tar.gz: ce4381f8146100aa27e14fada5f3d59cbc6e64174586dbefd395b28ded6175db7e9a8c631fa0c1d8a8cbd1c6934f771a63bebd87069d6524b6a94ba2778d4ebf
6
+ metadata.gz: 8a0d5c968fc216fe74ee01aa230bbf53fc4d70218969e62dec0c17f2bdcd365ebd20281db5165fe749cf1790d70ffc145c22cd8c28792d6d88a74eeb50d68110
7
+ data.tar.gz: 6469f1cd12b59bcf39ea2fff35fa374f7fc4fa985b158125c6bcd7c33a504457ef8e11d755f964ef892529f7531e895950dd16c919cafeeadeffd4bd5046cd33
data/conjoin.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "cuba", "~> 3.1.1", '>= 3.1.1'
22
22
  spec.add_dependency "cuba-sugar", "~> 0.3.0", '>= 0.3.0'
23
+ spec.add_dependency "dominate"
23
24
  spec.add_dependency "rack_csrf", "~> 2.4.0", '>= 2.4.0'
24
25
  spec.add_dependency "rack-protection", "~> 1.5.2", '>= 1.5.2'
25
26
  spec.add_dependency "r18n-core", "~> 1.1.10", '>= 1.1.10'
data/lib/conjoin.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "conjoin/version"
2
- require "conjoin/recursive_ostruct"
2
+ require "dominate/inflectors"
3
+ # require "conjoin/recursive_ostruct"
3
4
  require "conjoin/middleware"
4
5
  require "conjoin/env_string"
5
6
  require "conjoin/class_methods"
@@ -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 : HashIndifferent.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.72"
2
+ VERSION = "0.0.73"
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.72
4
+ version: 0.0.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
@@ -50,6 +50,20 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 0.3.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: dominate
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :runtime
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
53
67
  - !ruby/object:Gem::Dependency
54
68
  name: rack_csrf
55
69
  requirement: !ruby/object:Gem::Requirement