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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1af2fe3a0c96778393068c86ec9839d8025747dd
4
- data.tar.gz: 34c1f4b3425c891c226505eaabccb10158593d0c
3
+ metadata.gz: fe939c986a95a4baa7f598300146d7e6247f9b69
4
+ data.tar.gz: 084b5868e4f14229ee070851682c5ff2dba2222b
5
5
  SHA512:
6
- metadata.gz: 0c315eee702f8059fc7efb21229e35bd09842febe3ac917f4d6110e5d7c5112856ac9248c108b66fd33bab3ea10fba203f4fea8a7f45323220a399295fb14859
7
- data.tar.gz: 14614dfd77a4ca7d4ca5bbb80ece706421433dda36082a5cfd65b54dcbb572cc33d437c8e0be0257086fb509ba1df5ccd6a10d6f40ff3b8e9af39b60c37af7c6
6
+ metadata.gz: a30cb87402a350883dacdec185801524b4a8a2082f5df1efb912cf68c9336608611a4b53c2eb3399e7d5f4010c0123fd5c3ddb28272fb9829ef05a536273dc00
7
+ data.tar.gz: 46e2b596f13acb1e5feb090a0a7e887ad3c07e4b061ad259c3f313dd5e904103af1fa1671eab11f26d45f7e3e290f364d047fd7ce4e5fd1dd71d92e34efb3f0e
data/.travis.yml CHANGED
@@ -1,6 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
3
  - 2.2.2
5
4
  - ruby-head
6
5
  env:
@@ -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.2'
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.1.11' # disposable 0.1.14 has a dependency bug
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? ? form_class.new(resource) : resource
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.2
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: 2015-11-26 00:00:00.000000000 Z
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.1.11
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.1.11
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.8
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: