Class: FactoryBot::Generators::Base

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/factory_bot.rb

Overview

:nodoc:

Direct Known Subclasses

ModelGenerator

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



6
7
8
# File 'lib/generators/factory_bot.rb', line 6

def self.source_root
  @_factory_bot_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'factory_bot', generator_name, 'templates'))
end

Instance Method Details

#explicit_class_optionObject



10
11
12
# File 'lib/generators/factory_bot.rb', line 10

def explicit_class_option
  ", class: '#{class_name}'" unless class_name == singular_table_name.camelize
end