Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support Mongoid::Versioning #28

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

Does not support Mongoid::Versioning #28

mull opened this issue Jun 7, 2012 · 1 comment

Comments

@mull
Copy link

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
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant