Sha256: 7374d5ae98c7b2afe1bf76a328218a3d91019e7cf2e298aacc6401deffcbd1e8

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

module Reso
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path("../templates", __FILE__)

      desc "Copy RESO Data Dictionary migration files to your application."


      def self.next_migration_number(path)
        Time.now.utc.strftime("%Y%m%d%H%M%S%L")
      end

      def create_model_file
        template "enumerations.csv", "db/enumerations.csv"
        template "reso.rake", "lib/tasks/reso.rake"
        %w[addresses 
           businesses 
           enumerations 
           expenses
           imports
           import_results 
           listings
           listing_media 
           listing_providers 
           multiple_listing_services
           open_houses
           offices
           people
           participants 
           participant_licenses 
           places
           prices
           queued_listings
           rooms
           schools
           taxes
           join_tables].each do |name|
             migration_template "create_#{name}.rb", "db/migrate/create_#{name}.rb"
           end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reso-0.1.4.7 lib/generators/reso/install_generator.rb
reso-0.1.4.6 lib/generators/reso/install_generator.rb
reso-0.1.4.5 lib/generators/reso/install_generator.rb
reso-0.1.4.4 lib/generators/reso/install_generator.rb
reso-0.1.4.3 lib/generators/reso/install_generator.rb
reso-0.1.4.2 lib/generators/reso/install_generator.rb
reso-0.1.4.1 lib/generators/reso/install_generator.rb