rails_kindeditor 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,8 +68,10 @@ class Kindeditor::AssetUploader < CarrierWave::Uploader::Base
68
68
  end
69
69
 
70
70
  def filename
71
- @name ||= "#{Time.now.to_s(:number)}#{rand(100000)}"
72
- "#{@name}#{File.extname(original_filename).downcase}" if original_filename
71
+ if original_filename
72
+ @name ||= Digest::MD5.hexdigest(File.dirname(current_path)).slice(0, 12)
73
+ "#{@name}.#{file.extension}"
74
+ end
73
75
  end
74
76
 
75
77
  def self.save_upload_info?
@@ -1,4 +1,4 @@
1
1
  module RailsKindeditor
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_kindeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-15 00:00:00.000000000 Z
12
+ date: 2012-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: carrierwave
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  version: '0'
302
302
  requirements: []
303
303
  rubyforge_project: rails_kindeditor
304
- rubygems_version: 1.8.23
304
+ rubygems_version: 1.8.24
305
305
  signing_key:
306
306
  specification_version: 3
307
307
  summary: Kindeditor for Ruby on Rails