Class: Rails::QueryGenerator
- Inherits:
-
Generators::NamedBase
- Object
- Generators::NamedBase
- Rails::QueryGenerator
- Defined in:
- lib/generators/query/query_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_query_file ⇒ Object
7 8 9 |
# File 'lib/generators/query/query_generator.rb', line 7 def copy_query_file template 'query.rb', "app/queries/#{file_name}_query.rb" end |
#copy_query_test_file ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/generators/query/query_generator.rb', line 11 def copy_query_test_file if .test_suite == 'rspec' template 'query_spec.rb', "spec/queries/#{file_name}_query_spec.rb" elsif .test_suite == 'minitest' template 'query_test.rb', "test/queries/#{file_name}_query_test.rb" end end |