-
-
Save codeinmotion/91ae11c3ea889d5ee513 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module PaperclipStorageOption | |
| module ClassMethods | |
| def options | |
| Rails.env.production? ? production_options : default_options | |
| end | |
| private | |
| def production_options | |
| { | |
| storage: :dropbox, | |
| dropbox_credentials: Rails.root.join("config/dropbox.yml") | |
| } | |
| end | |
| def default_options | |
| {} | |
| end | |
| end | |
| extend ClassMethods | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| has_attached_file :image, { :styles => { :medium => "1200x800>" } }.merge(PaperclipStorageOption.options) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment