Sha256: 5f0bc6076f701eae259b6aa2fb4c28f437a80ef91fe53251c55ef29069a3245b
Contents?: true
Size: 967 Bytes
Versions: 18
Compression:
Stored size: 967 Bytes
Contents
module Uploadbox class ImageGenerator < Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) def create_initializers copy_file 'initializers/uploadbox.rb', 'config/initializers/uploadbox.rb' end def update_gitignore return unless File.exist?('.gitignore') append_to_file '.gitignore', "\npublic/uploads" end def copy_procfile copy_file 'Procfile', 'Procfile' end def add_route route "mount Uploadbox::Engine => '/uploadbox', as: :uploadbox" end def create_migration migration_template 'migrate/create_images.rb', 'db/migrate/create_images.rb' end private def self.next_migration_number(dirname) if ActiveRecord::Base.timestamped_migrations Time.now.utc.strftime('%Y%m%d%H%M%S') else '%.3d' % (current_migration_number(dirname) + 1) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems