Sha256: 048416f73f97d0c1e1f80f1ded551284168b891575237001b46c8036e9777b32
Contents?: true
Size: 960 Bytes
Versions: 3
Compression:
Stored size: 960 Bytes
Contents
require 'rails/generators' require 'rails/generators/migration' class PhotosManagerGenerator < Rails::Generators::Base include Rails::Generators::Migration def self.source_root @source_root ||= File.join(File.dirname(__FILE__), 'templates') end def self.next_migration_number(dirname) if ActiveRecord::Base.timestamped_migrations Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end def copy_swf copy_file "uploadify.swf", "app/assets/javascripts/uploadify.swf" end def mount_engine puts "Mounting PhotosManager::Engine in config/routes.rb..." insert_into_file("#{Rails.root}/config/routes.rb", :after => /routes.draw.do\n/) do %Q{ mount PhotosManager::Engine, :at => "/photos_manager"\n} end end def create_migration_file migration_template 'migration.rb', 'db/migrate/create_events_and_photos.rb' end end
Version data entries
3 entries across 3 versions & 1 rubygems