multi_client 2.0.0 → 2.0.1

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: 8e8d6f1bba813f694a3d7cff4c1795f87729eca3
4
- data.tar.gz: a9bdd2079350a3117833308a289e6ffde2221a60
3
+ metadata.gz: 59c04ee2319503a566144f0c9b51dfb6c367be6b
4
+ data.tar.gz: 88823dd3e94c27df8390314ff78f8665889c3147
5
5
  SHA512:
6
- metadata.gz: 24854fc5d4711fb3c868b5a509a28cd520ba863b0aa26d84c6cb6420526efb80ca1f2df7d53751d74a49f1042ec25e5553b69cf2e5db9fde8924168b6d3ec870
7
- data.tar.gz: bab0b66dd7d79c78d1092d7c140384409330bf4b872f803c0210e1c1681472afe2e02350a35a8318718fd64b06d4d4a1997592fc0e0eff7d3a3cd6373d0490a6
6
+ metadata.gz: f942def3bbd71389636eb77a2fc899a9dd129c1dff86d7315845ff173211138791e5e8a4df7a7b89cb235d860d7d83fc814aa4776d02f7078b25d70863f30ac5
7
+ data.tar.gz: e282abdca79c954bfea67afae411cd8449f81515e873256587c207f6e602e9845748bd38ad9d654218221c7425e76d75f2789ee2b891d880b09b2f8599b4e4dd
@@ -56,4 +56,14 @@ Correct:
56
56
  # Including the module after the class_method call.
57
57
  include MultiClient::ModelWithClient
58
58
  end
59
+
60
+ == Paperclip does not find assets when using the :class interpolation
61
+
62
+ When you save an asset with paperclip and use the unscoped version of a model (i.e. PostUnscoped). The file path will include the class name with the "_unscoped "suffix.
63
+
64
+ Trying to access this attachment with the regular, scoped version of the model fails, becuase the file path does not the "_unscoped" part.
65
+
66
+ Solution: This gem adds an interpolation called :class_without_unscoped. Use this interpolation in your url and path paperclip options instead of the origional :class_name.
67
+
68
+ = License
59
69
  This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,4 @@
1
+ Paperclip.interpolates :class_without_unscoped do |attachment, style|
2
+ return super() if attachment.nil? && style_name.nil?
3
+ attachment.instance.class.name.underscore.gsub("_unscoped", "").pluralize
4
+ end if Object.const_defined?('Paperclip')
@@ -1,3 +1,3 @@
1
1
  module MultiClient
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
@@ -144,6 +144,7 @@ files:
144
144
  - app/views/layouts/multi_client/application.html.erb
145
145
  - app/views/multi_client/_client_navigation.haml
146
146
  - app/views/multi_client/_current_client.html.erb
147
+ - config/initializers/paperclip_extensions.rb
147
148
  - config/locales/de.yml
148
149
  - config/locales/en.yml
149
150
  - config/routes.rb