slim_form_object 3.3.1 → 3.3.2

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
  SHA256:
3
- metadata.gz: d025bd65aee97a0bc92e6d9151b32b95bd6ad265d743920c4ec77d9db8ae7fd1
4
- data.tar.gz: c51ff0fc64d5fc21a366a0afbdc14256f2ac4ce6d818e6599b2d4edb506b5a92
3
+ metadata.gz: 3c1edda86a28889a997ba55334211f71950130d5cce53ebe306869947d97776d
4
+ data.tar.gz: da054ff6c868fd85424689e9288927b31a7af3936e681e211cc1efeaf72378fa
5
5
  SHA512:
6
- metadata.gz: 0e95a5333b55f512e825d4194339efd8eaf27b6b5925722d119aef451e4fde3c4bbcd1cda9739773fdfa949d24d8bec5e2a743afaa7e39e21d07f9aca2e8ddf8
7
- data.tar.gz: 6af8926329096a466ec25f021a0e849f27db9e60aa71938ce605e1c70bed20c8b68fd885af52b8d0ffdff3d5be906b11d83c5fb4575d2eeeac461e8d0e479a32
6
+ metadata.gz: 3d1e14cf1e415781b3aa91f0ba11050763380d36248cf71e694e539b9e374ecc10f0652f766f1ed82347ef6485ec747355738a5d872d4aa8a7272867b85e25a7
7
+ data.tar.gz: 23e31fae04c45844df16f169f14cadf069a1274e34548ad6494877f5faa0d90aea1ea7d2108012fb4a4d79a43195934bfb7a630e8f53557312a22e744f2aedff
@@ -3,11 +3,17 @@ module HelperMethods
3
3
  method( snake(model.to_s).to_sym ).call
4
4
  end
5
5
 
6
+ def make_constant_name(snake_model_name, base_module=nil)
7
+ pref = base_module ? (base_module.to_s + '::') : ''
8
+ pref + snake_model_name.to_s.split('_').map(&:capitalize).join
9
+ end
10
+
6
11
  def get_class_of(snake_model_name, base_module=nil)
7
- pref = base_module ? (base_module.to_s + '::') : ''
8
- Module.const_get( pref + snake_model_name.to_s.split('_').map(&:capitalize).join )
9
- rescue
10
- nil
12
+ Module.const_get( make_constant_name(snake_model_name, base_module) )
13
+ rescue NameError => ex
14
+ unless ex.class == NameError
15
+ raise ex
16
+ end
11
17
  end
12
18
 
13
19
  def to_bind_models(object_1, object_2)
@@ -1,3 +1,3 @@
1
1
  module SlimFormObject
2
- VERSION = "3.3.1"
2
+ VERSION = "3.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slim_form_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.2
5
5
  platform: ruby
6
6
  authors:
7
- - woodcrust
7
+ - nerzh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-10 00:00:00.000000000 Z
11
+ date: 2019-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -139,7 +139,7 @@ dependencies:
139
139
  description: Very simple automatic generation and saving nested attributes of models
140
140
  from html form. ActiveModel.
141
141
  email:
142
- - roboucrop@gmail.com
142
+ - emptystamp@gmail.com
143
143
  executables:
144
144
  - slim_form_object
145
145
  extensions: []
@@ -167,7 +167,7 @@ files:
167
167
  - spec/helpers/models.rb
168
168
  - spec/slim_form_object_spec.rb
169
169
  - spec/spec_helper.rb
170
- homepage: https://github.com/woodcrust/slim_form_object
170
+ homepage: https://github.com/nerzh/slim_form_object
171
171
  licenses:
172
172
  - MIT
173
173
  metadata: {}