Sha256: 162b617ba796da18dcf85b7e206be573b13177b84b38b99f0df0849047ea2e7c

Contents?: true

Size: 1.52 KB

Versions: 3

Compression:

Stored size: 1.52 KB

Contents

require 'rails/generators'
require 'tramway/core/generators/install_generator'

module Tramway::Event::Generators
  class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
    include Rails::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)

    def run_other_generators
    end

    def self.next_migration_number(path)
      next_migration_number = current_migration_number(path) + 1
      ActiveRecord::Migration.next_migration_number next_migration_number
    end

    def copy_migrations
      migration_template 'create_tramway_event_events.rb', 'db/migrate/create_tramway_event_events.rb'
      migration_template 'add_photo_to_tramway_event_events.rb', 'db/migrate/add_photo_to_tramway_event_events.rb'
      migration_template 'create_tramway_event_participant_form_fields.rb', 'db/migrate/create_tramway_event_participant_form_fields.rb'
      migration_template 'create_tramway_event_participants.rb', 'db/migrate/create_tramway_event_participants.rb'
      migration_template 'add_options_to_tramway_event_participant_form_fields.rb', 'db/migrate/add_options_to_tramway_event_participant_form_fields.rb'
      migration_template 'add_position_to_tramway_event_participant_form_fields.rb', 'db/migrate/add_position_to_tramway_event_participant_form_fields.rb'
      migration_template 'create_tramway_event_sections.rb', 'db/migrate/create_tramway_event_sections.rb'
      migration_template 'add_icon_to_tramway_event_sections.rb', 'db/migrate/add_icon_to_tramway_event_sections.rb'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tramway-event-1.2.1 lib/tramway/event/generators/install_generator.rb
tramway-event-1.2 lib/tramway/event/generators/install_generator.rb
tramway-event-1.1 lib/tramway/event/generators/install_generator.rb