The problem is that Refinery does not call Dragonfly.app.store(...) but installs Dragonfly as an extension to ActiveRecord:
# refinerycms/images/lib/refinery/images/dragonfly.rb
ActiveRecord::Base.extend ::Dragonfly::Model
ActiveRecord::Base.extend ::Dragonfly::Model::Validations
...
app_images = ::Dragonfly.app(:refinery_images)
...
if ::Refinery::Images.s3_backend
require 'dragonfly/s3_data_store'
options = {
bucket_name: Refinery::Images.s3_bucket_name,
access_key_id: Refinery::Images.s3_access_key_id,
secret_access_key: Refinery::Images.s3_secret_access_key
}
# S3 Region otherwise defaults to 'us-east-1'
options.update(region: Refinery::Images.s3_region) if Refinery::Images.s3_region
app_images.use_datastore :s3, options
end
I propose to add a :global_path configuration option (similar to :root_path) that will have the following behaviour. If :global_path is specified, it is used instead of generate_uid
This is an excellent gem and is used in RefineryCMS https://github.com/refinery/refinerycms . As a user of Refinery, I would like to be able to set the path on S3, as indicated in the docs here https://github.com/markevans/dragonfly-s3_data_store like so:
The problem is that Refinery does not call Dragonfly.app.store(...) but installs Dragonfly as an extension to ActiveRecord:
I propose to add a :global_path configuration option (similar to :root_path) that will have the following behaviour. If :global_path is specified, it is used instead of generate_uid
I understand that it will be my responsibility to make sure the paths are unique. Thanks!