Expose the paperclip options on CmsUpload to be amended in the configuration.
Ryan Garver
committed Mar 08, 2011
commit ecadd727ffaf6300c2b6f6fbdfdf468e13ba8049
Showing 3
changed files with
12 additions
and 3 deletions
app/models/cms_upload.rb
+1
-1
| @@ | @@ -1,7 +1,7 @@ |
| class CmsUpload < ActiveRecord::Base | |
| # -- AR Extensions -------------------------------------------------------- | |
| - | has_attached_file :file |
| + | has_attached_file :file, ComfortableMexicanSofa.config.upload_file_options |
| # -- Relationships -------------------------------------------------------- | |
| belongs_to :cms_site | |
config/initializers/comfortable_mexican_sofa.rb
+6
-1
| @@ | @@ -31,7 +31,12 @@ ComfortableMexicanSofa.configure do |config| |
| # page caching for CMS Layout CSS and Javascript. Enabled by default. When deploying | |
| # to an environment with read-only filesystem (like Heroku) turn this setting off. | |
| # config.enable_caching = true | |
| - | |
| + | |
| + | # File uploads use Paperclip and can support filesystem or s3 uploads. Override |
| + | # the upload method and appropriate settings based on Paperclip. For S3 see: |
| + | # http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3, and for |
| + | # filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/S3 |
| + | # config.upload_file_options = {:storage => :filesystem} |
| end | |
| # Default credentials for ComfortableMexicanSofa::HttpAuth | |
comfortable_mexican_sofa/configuration.rb b/lib/comfortable_mexican_sofa/configuration.rb
+5
-1
| @@ | @@ -26,6 +26,9 @@ class ComfortableMexicanSofa::Configuration |
| # Caching for css/js. For admin layout and ones for cms content. Enabled by default. | |
| attr_accessor :enable_caching | |
| + | |
| + | # Upload settings |
| + | attr_accessor :upload_file_options |
| # Configuration defaults | |
| def initialize | |
| @@ | @@ -37,6 +40,7 @@ class ComfortableMexicanSofa::Configuration |
| @auto_manage_sites = true | |
| @disable_irb = true | |
| @enable_caching = true | |
| + | @upload_file_options = {} |
| end | |
| - | end |
| \ No newline at end of file | |
| + | end |