anaconda 1.0.4 → 1.0.5

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: 7212d183f2965554be4f43394ea2dc65b396500b
4
- data.tar.gz: bb52c4c5f4c1dd7ded8004f825a43de5eb460c1d
3
+ metadata.gz: 901f5ceb0f88e31aff2a378a77a43846998338d9
4
+ data.tar.gz: af0d6a7cc3f4d573422916bc93ccc924ed84b4a8
5
5
  SHA512:
6
- metadata.gz: 80631dfd8a009772117b8fcd33aaa89b20fa0fe2f8ec82be36ec8378222f6f7baa723cddeaca084e22c87627f674937ef78400cfb6749e68d44a74701fd50dc2
7
- data.tar.gz: 5ea78f6fbc7867a8722780bdc76c5143865de7430f30b3e651917e8fa68fb476de0d34fe71ac451ce976252c65260662299c4b0018ca68b1f96411eb502b15b7
6
+ metadata.gz: 682cbdb2248ab87614384ed94272d51fc63d546bd3c37a42da9b9bec3ae2a773f464f76be9bf4836d830c3e224d1f9aa5ef70a64425d79ad71654ed0a37024e2
7
+ data.tar.gz: 5909013183d5bef236972edd7d38d36906cfb3f6cff6e7d3874b526071b98d7546336980915d21f98e8e05e97265b39c116fd99587162062396b97225d739e58
@@ -2,7 +2,7 @@
2
2
 
3
3
  Dead simple direct-to-s3 file uploading for your rails app.
4
4
 
5
- Current Version: 1.0.3
5
+ Current Version: 1.0.4
6
6
 
7
7
  ## Installation
8
8
 
@@ -202,6 +202,9 @@ If you return false to the following events it will prevent the default behavior
202
202
  From version 1.0.0 on we have used [Semantic Versioning](http://semver.org/).
203
203
 
204
204
  ## Changelog
205
+ * 1.0.5
206
+ * Fix bug where we were generating the same base_key for all instances if you didn't define a custom method
207
+
205
208
  * 1.0.4
206
209
  * Add `anaconda_form_data_for()` and `anaconda_form_data_for_all_columns` instance methods that return the raw data needed to upload to AWS
207
210
 
@@ -1,5 +1,5 @@
1
1
  module Anaconda
2
- MagicMethods = [:url, :download_url]
2
+ MagicMethods = [:url, :download_url, :anaconda_default_base_key]
3
3
  FieldSuffixes = [
4
4
  :filename,
5
5
  :file_path,
@@ -36,7 +36,7 @@ module Anaconda
36
36
  acl: "public-read",
37
37
  max_file_size: 500.megabytes,
38
38
  allowed_file_types: [],
39
- base_key: "#{self.to_s.pluralize.downcase}/#{anaconda_column.to_s.pluralize}/#{(0...32).map{(65+rand(26)).chr}.join.downcase}",
39
+ base_key: "#{anaconda_column}_anaconda_default_base_key".to_sym,
40
40
  host: false,
41
41
  protocol: "http",
42
42
  remove_previous_s3_files_on_change: true,
@@ -77,7 +77,9 @@ module Anaconda
77
77
  when :url
78
78
  anaconda_url(checking_column, *args)
79
79
  when :download_url
80
- anaconda_download_url(checking_column)
80
+ anaconda_download_url(checking_column)
81
+ when :anaconda_default_base_key
82
+ anaconda_default_base_key_for(checking_column)
81
83
  else
82
84
  super
83
85
  end
@@ -145,6 +147,10 @@ module Anaconda
145
147
  end
146
148
  end
147
149
 
150
+ def anaconda_default_base_key_for(column_name)
151
+ "#{self.class.to_s.pluralize.downcase}/#{column_name.to_s.pluralize}/#{(0...32).map{(65+rand(26)).chr}.join.downcase}"
152
+ end
153
+
148
154
  def anaconda_remove_previous_s3_files_on_change_or_destroy
149
155
 
150
156
  if self.destroyed?
@@ -1,5 +1,5 @@
1
1
  module Anaconda
2
2
  module Rails
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anaconda
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McFadden