Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Does not support Mongoid::Versioning #28

Open
mull opened this Issue Jun 7, 2012 · 1 comment

Comments

Projects
None yet
1 participant

mull commented Jun 7, 2012

In a model like:

class Mockup
  include Mongoid::Document
  include Mongoid::Paperclip
  include Mongoid::Versioning

  has_mongoid_attached_file :screenshot,
    :url => '/system/mockups/:id/:version/:id.:extension',
    :path => ':rails_root/public:url'

  Paperclip.interpolates :version  do |attachment, style|
    attachment.instance.version
  end
end

Attached files are not kept when updating the model, Paperclip throws them away and on top of that the ':version' part of the url remains '1' (<%= image_tag mockup.screenshot %>).

mull commented Jun 7, 2012

So the :url is actually updated, it's the :path that is not correctly updated according to :version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment