Sha256: 3c5b59bd38ec196a5fe3cafbae0c9af4247ea8c60f70fe22803fa0e684a2875f
Contents?: true
Size: 1.36 KB
Versions: 38
Compression:
Stored size: 1.36 KB
Contents
module EffectiveEvents module Generators class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration desc 'Creates an EffectiveEvents initializer in your application.' source_root File.expand_path('../../templates', __FILE__) def self.next_migration_number(dirname) if not 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_initializer template ('../' * 3) + 'config/effective_events.rb', 'config/initializers/effective_events.rb' end def create_migration_file @events_table_name = ':' + EffectiveEvents.events_table_name.to_s @event_products_table_name = ':' + EffectiveEvents.event_products_table_name.to_s @event_addons_table_name = ':' + EffectiveEvents.event_addons_table_name.to_s @event_registrants_table_name = ':' + EffectiveEvents.event_registrants_table_name.to_s @event_registrations_table_name = ':' + EffectiveEvents.event_registrations_table_name.to_s @event_tickets_table_name = ':' + EffectiveEvents.event_tickets_table_name.to_s migration_template ('../' * 3) + 'db/migrate/01_create_effective_events.rb.erb', 'db/migrate/create_effective_events.rb' end end end end
Version data entries
38 entries across 38 versions & 1 rubygems