simple_form_attachments 0.1.1 → 0.1.2

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: 1768b0dae47cf67d3afe9efabd8269d744f0d478
4
- data.tar.gz: b0548fed6344f4383b928857b405788e118ed72b
3
+ metadata.gz: db69b98f356fc23ec406f4a46dbdd54226caf547
4
+ data.tar.gz: 93164e01fb99075461cbb3f664c7de259f860d05
5
5
  SHA512:
6
- metadata.gz: 03260891999b62f5c629edcf15072889923447816642d68b07bc609f2da1919ae06c2ab226863e9be909fc0be97449324f06658dcb6f0c5e2715dad395065db7
7
- data.tar.gz: 564e1b23f2a291af9fdf798333b9875b951c7b68bbaeee556aca7ad3a8518e7be910bf57d2758b6714fa1172f4ef9e89363e5f00407fd73a0437c8674ce95ed1
6
+ metadata.gz: 3a8caeedf281a7bb1b989c410896b585108b1dda35e4eb1df20343897fffd34b486a7c1caed2e78ff32f8869b137b933849b16b7ae3a57fed5ffde2d6551618f
7
+ data.tar.gz: 63e4f52d55bc312c77519e3129e9f2d906affe85b8a7ef550fdfad17cfffc51a1b07f10f12c75079882f8be2df6ed36eb02d1006bcb0e40b093354cc0d472c73
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form_attachments (0.1.1)
4
+ simple_form_attachments (0.1.2)
5
5
  jquery-ui-rails
6
6
  rails (>= 4.2)
7
7
  rails-assets-blueimp-file-upload (>= 9.6.0)
@@ -152,7 +152,7 @@ GEM
152
152
  rails-assets-jquery (>= 1.6)
153
153
  rails-assets-blueimp-load-image (1.14.0)
154
154
  rails-assets-blueimp-tmpl (2.5.5)
155
- rails-assets-handlebars (4.0.2)
155
+ rails-assets-handlebars (4.0.3)
156
156
  rails-assets-jquery (2.1.4)
157
157
  rails-deprecated_sanitizer (1.0.3)
158
158
  activesupport (>= 4.2.0.alpha)
@@ -176,7 +176,7 @@ GEM
176
176
  mime-types (>= 1.16, < 3.0)
177
177
  netrc (~> 0.7)
178
178
  shellany (0.0.1)
179
- simple_form (3.1.1)
179
+ simple_form (3.2.0)
180
180
  actionpack (~> 4.0)
181
181
  activemodel (~> 4.0)
182
182
  simplecov (0.10.0)
@@ -188,9 +188,9 @@ GEM
188
188
  temple (~> 0.7.3)
189
189
  tilt (>= 1.3.3, < 2.1)
190
190
  slop (3.6.0)
191
- sprockets (3.3.4)
192
- rack (~> 1.0)
193
- sprockets-rails (2.3.2)
191
+ sprockets (3.3.5)
192
+ rack (> 1, < 3)
193
+ sprockets-rails (2.3.3)
194
194
  actionpack (>= 3.0)
195
195
  activesupport (>= 3.0)
196
196
  sprockets (>= 2.8, < 4.0)
data/README.md CHANGED
@@ -184,6 +184,7 @@ require 'simple_form_attachments'
184
184
 
185
185
  SimpleFormAttachments::AttachmentInput.configure do |c|
186
186
  c.route = attachments_path
187
+ # can be also specified as a lambda to be evaluated at runtime: -> { attachments_path }
187
188
  end
188
189
  ```
189
190
 
@@ -40,7 +40,7 @@ module SimpleFormAttachments
40
40
  def input_html_options
41
41
  super.merge!(
42
42
  data: {
43
- attachments_path: options.fetch(:route, AttachmentInput.configuration.route),
43
+ attachments_path: options.fetch(:route, route_from_configuration),
44
44
  max_number_of_files: options.fetch(:max_number_of_files, nil),
45
45
  disabled_submit_text: I18n.t(:disabled, scope: 'simple_form_attachments.buttons'),
46
46
  sortable: sortable?.to_s
@@ -54,6 +54,13 @@ module SimpleFormAttachments
54
54
 
55
55
  # ---------------------------------------------------------------------
56
56
 
57
+ def route_from_configuration
58
+ res = AttachmentInput.configuration.route
59
+ res.respond_to?(:call) ? res.call : res
60
+ end
61
+
62
+ # ---------------------------------------------------------------------
63
+
57
64
  def relation
58
65
  return unless @builder
59
66
  return unless @builder.object
@@ -1,3 +1,3 @@
1
1
  module SimpleFormAttachments
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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.1.1
4
+ version: 0.1.2
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-09-05 00:00:00.000000000 Z
12
+ date: 2015-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails