super_tools 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/super_form/reform.rb +4 -20
- data/lib/super_tools/version.rb +1 -1
- data/super_tools.gemspec +1 -1
- metadata +2 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ab3145121a1328b037bf853039e4115ac92629
|
4
|
+
data.tar.gz: 04b5e71f0f34df059751464ef110134690ec40d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b896b48cc2c64a98c60ff8b38017e5d813d129b55ec8049b78e25db585ad59cea1a19d018d593ef6d98fc80b8977a4feab252a05c39ee6a48cb445d8d9d63dd
|
7
|
+
data.tar.gz: 33c5d969561f0657062c5993942e4a0b611608af017e1fe70087adcb1c5a03598b62446766a101737deb3bf59679657dd85f44a9de2fee1f2ecd0ed17c965cff
|
data/lib/super_form/reform.rb
CHANGED
@@ -1,24 +1,14 @@
|
|
1
1
|
require 'super_form/concerns/atomic_save'
|
2
|
-
require 'disposable'
|
3
2
|
require 'reform'
|
4
3
|
require 'reform/form'
|
5
|
-
require 'reform/
|
6
|
-
require 'reform/form/active_model'
|
7
|
-
require 'reform/form/active_model/form_builder_methods'
|
8
|
-
require "reform/form/active_model/validations"
|
4
|
+
require 'reform/active_record'
|
9
5
|
require "reform/form/coercion"
|
6
|
+
require 'disposable'
|
10
7
|
require 'disposable/twin/parent'
|
11
8
|
|
12
|
-
Reform::Form.class_eval do
|
13
|
-
extend ActiveModel::Naming
|
14
|
-
extend ActiveModel::Translation
|
15
|
-
end
|
16
|
-
|
17
9
|
class SuperForm::Reform < Reform::Form
|
18
10
|
include SuperForm::AtomicSave
|
19
|
-
|
20
|
-
include ::Reform::Form::ActiveModel
|
21
|
-
include ::Reform::Form::ActiveModel::FormBuilderMethods
|
11
|
+
extend ::ActiveModel::Translation
|
22
12
|
feature Coercion
|
23
13
|
|
24
14
|
# 定義 i18n scope
|
@@ -33,14 +23,8 @@ class SuperForm::Reform < Reform::Form
|
|
33
23
|
def self.form_name(name)
|
34
24
|
# 定義 form name (給 form 用的)
|
35
25
|
define_singleton_method :model_name do
|
36
|
-
active_model_name_for(name.to_s.camelize)
|
26
|
+
active_model_name_for(name.to_s.camelize) # Reform::Form::ActiveModel
|
37
27
|
end
|
38
28
|
model(name)
|
39
29
|
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def self.active_model_name_for(string)
|
44
|
-
::ActiveModel::Name.new(self, nil, string)
|
45
|
-
end
|
46
30
|
end
|
data/lib/super_tools/version.rb
CHANGED
data/super_tools.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency "shoulda-context"
|
30
30
|
|
31
31
|
|
32
|
-
spec.add_dependency "rails", ">= 4"
|
32
|
+
spec.add_dependency "rails", ">= 4"
|
33
33
|
# spec.add_dependency "i18n", "< 1"
|
34
34
|
# spec.add_dependency "actionview", '>= 4', '<= 6'
|
35
35
|
# spec.add_dependency 'activerecord', '>= 4', '<= 6'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eddie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,9 +73,6 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '4'
|
76
|
-
- - "<="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '5'
|
79
76
|
type: :runtime
|
80
77
|
prerelease: false
|
81
78
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -83,9 +80,6 @@ dependencies:
|
|
83
80
|
- - ">="
|
84
81
|
- !ruby/object:Gem::Version
|
85
82
|
version: '4'
|
86
|
-
- - "<="
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '5'
|
89
83
|
- !ruby/object:Gem::Dependency
|
90
84
|
name: nokogiri
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|