activeadmin-reform 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/activeadmin-reform.gemspec +2 -2
- data/lib/active_admin/reform/forms.rb +11 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe939c986a95a4baa7f598300146d7e6247f9b69
|
4
|
+
data.tar.gz: 084b5868e4f14229ee070851682c5ff2dba2222b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30cb87402a350883dacdec185801524b4a8a2082f5df1efb912cf68c9336608611a4b53c2eb3399e7d5f4010c0123fd5c3ddb28272fb9829ef05a536273dc00
|
7
|
+
data.tar.gz: 46e2b596f13acb1e5feb090a0a7e887ad3c07e4b061ad259c3f313dd5e904103af1fa1671eab11f26d45f7e3e290f364d047fd7ce4e5fd1dd71d92e34efb3f0e
|
data/.travis.yml
CHANGED
data/activeadmin-reform.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'activeadmin-reform'
|
7
|
-
spec.version = '0.1.
|
7
|
+
spec.version = '0.1.4'
|
8
8
|
spec.authors = ['Artyom Bolshakov']
|
9
9
|
spec.email = ['abolshakov@spbtv.com']
|
10
10
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
21
|
spec.add_dependency 'rails', '>= 3.2'
|
22
|
-
spec.add_dependency 'disposable', '0.
|
22
|
+
spec.add_dependency 'disposable', '>= 0.2.0'
|
23
23
|
spec.add_dependency 'reform', '>= 2.0'
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
@@ -15,11 +15,21 @@ module ActiveAdmin
|
|
15
15
|
# @param resource [ActiveRecord::Base]
|
16
16
|
# @return [ActiveRecord::Base, Reform::Form]
|
17
17
|
def apply_form(resource)
|
18
|
-
apply_form?
|
18
|
+
if apply_form?
|
19
|
+
form = form_class.new(resource)
|
20
|
+
form.prepopulate! if prepopulate_form?
|
21
|
+
form
|
22
|
+
else
|
23
|
+
resource
|
24
|
+
end
|
19
25
|
end
|
20
26
|
|
21
27
|
private
|
22
28
|
|
29
|
+
def prepopulate_form?
|
30
|
+
%w(new edit).include?(action_name)
|
31
|
+
end
|
32
|
+
|
23
33
|
def apply_form?
|
24
34
|
case action_name
|
25
35
|
when 'new', 'edit', 'update', 'create'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-reform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artyom Bolshakov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: disposable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: reform
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,9 +156,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.4.
|
159
|
+
rubygems_version: 2.4.5.1
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Integrates ActiveAdmin with Reform
|
163
163
|
test_files: []
|
164
|
-
has_rdoc:
|