class Rails::QueryGenerator
Public Instance Methods
copy_files()
click to toggle source
# File lib/generators/rails/query_generator.rb, line 9 def copy_files path = File.join('app', 'queries', class_path, "#{file_name}_query.rb") template('query.rb.tt', path) end
Private Instance Methods
file_name()
click to toggle source
Calls superclass method
# File lib/generators/rails/query_generator.rb, line 16 def file_name @_file_name ||= remove_possible_suffix(super) end
remove_possible_suffix(name)
click to toggle source
# File lib/generators/rails/query_generator.rb, line 20 def remove_possible_suffix(name) name.sub(/_?query$/i, '') end