Sha256: aab6a0b47ac55486254225f5aadf040cd2c52e497228a4eb43e38170d6373904

Contents?: true

Size: 472 Bytes

Versions: 21

Compression:

Stored size: 472 Bytes

Contents

require "rails/generators"

module Generators
  module Avo
    class FilterGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path("templates", __dir__)
      class_option :select, type: :boolean

      namespace "avo:filter"

      def create_resource_file
        type = "boolean"

        type = "select" if options[:select]

        template "filters/#{type}_filter.rb", "app/services/avo/filters/#{singular_name}.rb"
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
avo-1.2.7 lib/generators/avo/filter_generator.rb
avo-1.2.6 lib/generators/avo/filter_generator.rb
avo-1.2.6.pre.1 lib/generators/avo/filter_generator.rb
avo-1.2.5 lib/generators/avo/filter_generator.rb
avo-1.2.4 lib/generators/avo/filter_generator.rb
avo-1.2.3 lib/generators/avo/filter_generator.rb
avo-1.3.0.pre.1 lib/generators/avo/filter_generator.rb
avo-1.2.2 lib/generators/avo/filter_generator.rb
avo-1.1.0 lib/generators/avo/filter_generator.rb
avo-1.1.0.pre.1 lib/generators/avo/filter_generator.rb
avo-1.0.5 lib/generators/avo/filter_generator.rb
avo-1.0.4 lib/generators/avo/filter_generator.rb
avo-1.0.2 lib/generators/avo/filter_generator.rb
avo-1.0.1 lib/generators/avo/filter_generator.rb
avo-1.0.0 lib/generators/avo/filter_generator.rb
avo-0.5.0.beta15 lib/generators/avo/filter_generator.rb
avo-0.5.0.beta14 lib/generators/avo/filter_generator.rb
avo-0.5.0.beta13 lib/generators/avo/filter_generator.rb
avo-0.5.0.beta12 lib/generators/avo/filter_generator.rb
avo-0.5.0.beta11 lib/generators/avo/filter_generator.rb