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.27.2 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.27.1 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.27 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.26 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.25 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.24 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.23 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.22 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.21 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.20 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.19 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.18 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.17 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.16 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.15 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.14 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.13 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.12 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.11 lib/generators/j7_w1/model/model_generator.rb
j7w1-0.0.10 lib/generators/j7_w1/model/model_generator.rb