modulate 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ class Modulate::Document < ActiveRecord::Base
13
13
 
14
14
  def key
15
15
  return if filename.blank? || attachable.blank? || attachable.id.blank?
16
- self[:key] ||= "#{attachable.id}-#{filename}"
16
+ self[:key] ||= "#{attachable.id}-#{Time.now.to_i}-#{filename}"
17
17
  end
18
18
 
19
19
  def bucket
@@ -1,8 +1,8 @@
1
1
  module Modulate::Relation
2
2
 
3
3
  def modulate(name=:modulate_documents, options={})
4
- has_many name, {as: :attachable, class_name: "Modulate::Document"}.reverse_merge(options) # for uploading
5
- has_many :modulate_uploads, as: :attachable, class_name: 'Modulate::Document' # for creating
4
+ has_many name, {as: :attachable, class_name: "Modulate::Document", inverse_of: :attachable}.reverse_merge(options) # for uploading
5
+ has_many :modulate_uploads, as: :attachable, class_name: 'Modulate::Document', inverse_of: :attachable # for creating
6
6
  accepts_nested_attributes_for :modulate_uploads
7
7
  accepts_nested_attributes_for name
8
8
  attr_accessor :"#{Modulate.configuration.user_method}" unless Modulate.configuration.user_method == nil
@@ -1,3 +1,3 @@
1
1
  module Modulate
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  segments:
309
309
  - 0
310
- hash: -468336500448220773
310
+ hash: -4228869101632807919
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  none: false
313
313
  requirements:
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  version: '0'
317
317
  segments:
318
318
  - 0
319
- hash: -468336500448220773
319
+ hash: -4228869101632807919
320
320
  requirements: []
321
321
  rubyforge_project:
322
322
  rubygems_version: 1.8.24