simple_form_attachments 0.0.3 → 0.0.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: c9a5c319213f317e70a166e3e49718c37718bf83
4
- data.tar.gz: e0b0ef28e15e3a16a71a5898dc05aa68e8547c4d
3
+ metadata.gz: 1540e6d1e827ffdfacb5bf1fabb16add5326a15a
4
+ data.tar.gz: be5daa41dee23d745418119e798407f4e88e7c5c
5
5
  SHA512:
6
- metadata.gz: 0ef45ae2d9ddfba2c55a81387b66b91aa2ee631f0c16a4c017404259847fd6222375ccdcf7b113255edf1370e9a920426d2838e4723b75075d844eedec00c9a4
7
- data.tar.gz: 403806c061ed7c5e78154e39dcc465169bf17a06fd19db1dd105eb354b8a9cee18fd91b9c7d7a8283a5121de60779b4d2d21e2f759aa07d8c7c4b34e6fa4033c
6
+ metadata.gz: 3e57492026a7dc0e6bb79051ea58d642f77a4be62c5e5fb14477b812f05c3cb7d09b0f3e2961664008b6cf26eac1df906bed84b38516d9e716c6aafc032575b8
7
+ data.tar.gz: d7081f1fb537c5be4c22165dd5671478d5e7b24617f7c200e71bed50aa1eee7dc36052c404d214ef720cf20e8172e5b775e338ec784222623aa71acd3a0df238
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_attachments (0.0.3)
4
+ simple_form_attachments (0.0.4)
5
5
  jquery-ui-rails
6
6
  rails (>= 4.2)
7
7
  rails-assets-blueimp-file-upload (>= 9.6.0)
@@ -1,4 +1,4 @@
1
- - form = ActionView::Helpers::FormBuilder.new(parent_class.to_s.downcase.to_sym, parent, self, {})
1
+ - form = ActionView::Helpers::FormBuilder.new(parent_class.model_name.param_key, parent, self, {})
2
2
 
3
3
  = form.simple_fields_for attachment_relation[:name].to_sym, attachment, { child_index: child_index } do |fields|
4
4
  - partial_locals = { attachment: attachment, form: form, fields: fields, multiple: multiple, relation_key: attachment_relation[:key] }
@@ -75,7 +75,9 @@ module SimpleFormAttachments
75
75
  @builder.object_name
76
76
  end
77
77
 
78
+ # FIXME: this should be inferred also from the :as options!!
78
79
  def parent_class
80
+ return @builder.object.model.class.name if @builder.object.class.name.to_s =~ /decorator\z/i
79
81
  @builder.object.class.name
80
82
  end
81
83
 
@@ -206,7 +208,7 @@ module SimpleFormAttachments
206
208
  table_classes << 'sortable' if sortable?
207
209
  template.content_tag :table, class: table_classes do
208
210
  @builder.simple_fields_for attribute_name do |attachment_fields|
209
- template.render partial: attachment_fields.object, format: :html, layout: 'layouts/simple_form_attachments/attachment_layout',
211
+ template.render partial: attachment_fields.object.to_partial_path, format: :html, layout: 'layouts/simple_form_attachments/attachment_layout',
210
212
  locals: {
211
213
  attachment: attachment_fields.object,
212
214
  fields: attachment_fields,
@@ -1,3 +1,3 @@
1
1
  module SimpleFormAttachments
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../../simple_form_attachments
3
3
  specs:
4
- simple_form_attachments (0.0.2)
4
+ simple_form_attachments (0.0.4)
5
5
  jquery-ui-rails
6
6
  rails (>= 4.2)
7
7
  rails-assets-blueimp-file-upload (>= 9.6.0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_attachments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Celizna
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-28 00:00:00.000000000 Z
12
+ date: 2015-07-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails