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 +4 -4
- data/active_form_model.gemspec +5 -0
- data/lib/active_form_model.rb +7 -1
- data/lib/active_form_model/version.rb +1 -1
- metadata +48 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6f0169a331b87482d384004270960ba223bea6c9155f1f90c81ff62263f635a
|
4
|
+
data.tar.gz: 9941258627c2434915e1e009fcb0f0636490ffff31d88dff22bc1925fa069b47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4259f13547d8b20608b99678863b885605f9b028cab61f0c18ef7317ae43dd5f29ad8664d4a18c55880451b63ffe2fcc0ef16901553ee604975197abc84338f7
|
7
|
+
data.tar.gz: 2dd3e719e35c7480611d48f1e77ad3582f7fb2612dd2b0f5c525153559d863e36b55f974e459330c0e63cddea7d7f580b36db455da0bc83e4f41d2694a3e2aa6
|
data/active_form_model.gemspec
CHANGED
@@ -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
|
data/lib/active_form_model.rb
CHANGED
@@ -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
|
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.
|
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:
|
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: []
|