Sha256: ac003876f2aef16a4dc95e6a4d71ec796f0e1fa5f801d98ad4044505696aada9

Contents?: true

Size: 722 Bytes

Versions: 29

Compression:

Stored size: 722 Bytes

Contents

require 'rails/generators'

module J7W1
  class ModelGenerator < Rails::Generators::Base
    source_root File.join(File.dirname(__FILE__), 'templates')
    class_option :async_engine, type: :string, default: nil,
      desc: 'AWS register/deregister processing method'

    def create_model_file
      template "j7_w1_application_device.rb.erb",
        "app/models/j7_w1_application_device.rb"

      if options['async_engine'] == 'sidekiq'
        copy_file "j7_w1_create_endpoint_worker.rb",
          "app/workers/j7_w1_create_endpoint_worker.rb"
        copy_file "j7_w1_destroy_endpoint_worker.rb",
          "app/workers/j7_w1_destroy_endpoint_worker.rb"
      end

      invoke "j7_w1:migration"
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
j7w1-0.0.9 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.8 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.7 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.6 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.5 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.4 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.3 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.2 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.1 lib/generators/j7_w1/model/model_generator.rb