Class: Rails::Generators::QueryGenerator

Inherits:
NamedBase
  • Object
show all
Defined in:
lib/generators/query/query_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_query_definitions_fileObject



20
21
22
# File 'lib/generators/query/query_generator.rb', line 20

def create_query_definitions_file
  template "query_definitions.rb", File.join("app/queries/definitions", class_path, "#{file_name}_query_definitions.rb")
end

#create_query_fileObject



16
17
18
# File 'lib/generators/query/query_generator.rb', line 16

def create_query_file
  template "query.rb", File.join("app/queries", class_path, "#{file_name}_query.rb")
end

#create_query_test_fileObject



24
25
26
27
28
# File 'lib/generators/query/query_generator.rb', line 24

def create_query_test_file
  unless options[:skip_unit_test]
    template "unit_test.rb", File.join("test/queries", class_path, "#{file_name}_query_test.rb")
  end
end