active_form_model 0.2.0 → 0.3.0

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: 5137b6aa0942b3579c267727c5931e301685315538434fae74b11163f00cd294
4
- data.tar.gz: 9cbd8454a8d71115b9cd16ea36e70fae3d5fd36ef31be1db60582bab31e11c46
3
+ metadata.gz: e6f0169a331b87482d384004270960ba223bea6c9155f1f90c81ff62263f635a
4
+ data.tar.gz: 9941258627c2434915e1e009fcb0f0636490ffff31d88dff22bc1925fa069b47
5
5
  SHA512:
6
- metadata.gz: bcf09ef8ca148879c592559f75dc61ef682231ab20e405a8e948067aa7380635b56163378fcf0320d330760174494ca98a13b5db357e555c03bc041cc58b13d1
7
- data.tar.gz: 8e920323d9e7f3b2bc3df89fcb31f7cb50eacf8294a7c74a17fa6910a07341f6be1c4e73bb3afb9355b29b713285028656b1144cf493065275bb372fc5a34a40
6
+ metadata.gz: 4259f13547d8b20608b99678863b885605f9b028cab61f0c18ef7317ae43dd5f29ad8664d4a18c55880451b63ffe2fcc0ef16901553ee604975197abc84338f7
7
+ data.tar.gz: 2dd3e719e35c7480611d48f1e77ad3582f7fb2612dd2b0f5c525153559d863e36b55f974e459330c0e63cddea7d7f580b36db455da0bc83e4f41d2694a3e2aa6
@@ -26,4 +26,9 @@ Gem::Specification.new do |spec|
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency("activesupport", ">= 3")
31
+
32
+ spec.add_development_dependency("activemodel", ">= 5")
33
+ spec.add_development_dependency("actionpack", ">= 5")
29
34
  end
@@ -1,4 +1,5 @@
1
1
  require 'active_form_model/version'
2
+ require 'active_support/concern'
2
3
 
3
4
  module ActiveFormModel
4
5
  class Error < StandardError; end
@@ -26,7 +27,7 @@ module ActiveFormModel
26
27
  end
27
28
 
28
29
  def _permitted_args
29
- @_permitted_args || []
30
+ @_permitted_args || (superclass.respond_to?(:_permitted_args) && superclass._permitted_args) || []
30
31
  end
31
32
  end
32
33
 
@@ -40,6 +41,11 @@ module ActiveFormModel
40
41
  super(permitted_attrs)
41
42
  end
42
43
 
44
+ def assign_attributes(attrs = {})
45
+ permitted_attrs = permit_attrs(attrs)
46
+ super(permitted_attrs)
47
+ end
48
+
43
49
  def permit_attrs(attrs)
44
50
  attrs.respond_to?(:permit) ? attrs.send(:permit, self.class._permitted_args) : attrs
45
51
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveFormModel
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,15 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_form_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-14 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activemodel
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: actionpack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '5'
13
55
  description: Based on inheritance
14
56
  email:
15
57
  - mokevnin@gmail.com
@@ -39,7 +81,7 @@ licenses:
39
81
  metadata:
40
82
  homepage_uri: https://github.com/Hexlet/active_form_model
41
83
  source_code_uri: https://github.com/Hexlet/form-model.git
42
- post_install_message:
84
+ post_install_message:
43
85
  rdoc_options: []
44
86
  require_paths:
45
87
  - lib
@@ -55,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
97
  version: '0'
56
98
  requirements: []
57
99
  rubygems_version: 3.1.2
58
- signing_key:
100
+ signing_key:
59
101
  specification_version: 4
60
102
  summary: Painless forms for ActiveRecord
61
103
  test_files: []