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

Upgrading to bcms 3.3.1 #6

Open
mezza opened this issue Aug 24, 2011 · 1 comment
Open

Upgrading to bcms 3.3.1 #6

mezza opened this issue Aug 24, 2011 · 1 comment

Comments

@mezza
Copy link

mezza commented Aug 24, 2011

I'm attempting to upgrade my existing browsercms application - which uses bcms_s3 for asset storage - to the latest version of the Rails 3 compatible gem.

Running into an issue with uninitialized constant Cms::AttachmentsController is s3_module.rb.

Any pointers on how to fix?

Regards,

Mezza

@mezza
Copy link
Author

mezza commented Aug 24, 2011

If it helps, I've found a workaround which is to comment the last block of the s3_module.rb and put the contents into the initializer/browsercms.rb:

=begin
Cms::AttachmentsController.send(:include, Cms::S3::AttachmentsController)
Cms::ContentController.send(:include, Cms::S3::ContentController)
Attachment.send(:include, Cms::S3::Attachment)
Cms::ApplicationController.send(:include, Cms::S3::ApplicationController)

ensure S3 storage disabled by default

Cms::S3.enabled = false if Cms::S3.enabled.nil?

ensure heroku caching disabled by default

Cms::S3.heroku_caching = false if Cms::S3.heroku_caching.nil?

function to set domain prefix without url to 'www' is disabled by default

Cms::S3.www_domain_prefix = false if Cms::S3.www_domain_prefix.nil?

load s3 options if s3.yml exists

if File.exists?("#{RAILS_ROOT}/config/s3.yml")
yaml_string = IO.read("#{RAILS_ROOT}/config/s3.yml")
Cms::S3.options = YAML::load(ERB.new(yaml_string).result)
Cms::S3.options.symbolize_keys!
end
=end

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