Class: Generators::Avo::FilterGenerator

Inherits:
NamedBaseGenerator show all
Defined in:
lib/generators/avo/filter_generator.rb

Instance Method Summary collapse

Methods inherited from NamedBaseGenerator

#initialize

Constructor Details

This class inherits a constructor from Generators::Avo::NamedBaseGenerator

Instance Method Details

#create_resource_fileObject



14
15
16
17
18
19
20
21
22
# File 'lib/generators/avo/filter_generator.rb', line 14

def create_resource_file
  type = "boolean"

  type = "multiple_select" if options[:multiple_select]
  type = "select" if options[:select]
  type = "text" if options[:text]

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