Class: S3Multipart::UploaderGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- S3Multipart::UploaderGenerator
- Defined in:
- lib/generators/s3_multipart/uploader_generator.rb
Instance Method Summary collapse
- #create_migrations ⇒ Object
-
#create_uploader ⇒ Object
class_option :migrations, :type => :boolean, :default => true, :description => “Create migration files”.
Instance Method Details
#create_migrations ⇒ Object
17 18 19 20 |
# File 'lib/generators/s3_multipart/uploader_generator.rb', line 17 def create_migrations # return unless options.migrations? template "add_uploader_column_to_model.rb", "db/migrate/#{migration_time}_add_uploader_to_#{model}.rb" end |
#create_uploader ⇒ Object
class_option :migrations, :type => :boolean, :default => true, :description => “Create migration files”
11 12 13 14 15 |
# File 'lib/generators/s3_multipart/uploader_generator.rb', line 11 def create_uploader empty_directory("app/uploaders") empty_directory("app/uploaders/multipart") template "uploader.rb", "app/uploaders/multipart/#{model}_uploader.rb" end |