Class: FactoryBotGenerator::Base
- Inherits:
-
Object
- Object
- FactoryBotGenerator::Base
- Defined in:
- lib/factory_bot_generator.rb
Constant Summary collapse
- QUOTE_AROUND_VALUE_TYPES =
i[string date datetime text].freeze
- EXCLUDE_COLUMNS =
%w[created_at updated_at].freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(record, options) ⇒ Base
constructor
A new instance of Base.
- #render ⇒ Object
Constructor Details
#initialize(record, options) ⇒ Base
16 17 18 19 |
# File 'lib/factory_bot_generator.rb', line 16 def initialize(record, ) @record = record = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/factory_bot_generator.rb', line 14 def end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
14 15 16 |
# File 'lib/factory_bot_generator.rb', line 14 def record @record end |
Class Method Details
.render(record, options = {}) ⇒ Object
10 11 12 |
# File 'lib/factory_bot_generator.rb', line 10 def self.render(record, = {}) new(record, ).render end |
Instance Method Details
#render ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/factory_bot_generator.rb', line 21 def render ActionView::Base.new(File.dirname(__FILE__)).render( file: 'factory_bot_generator.erb', locals: { name: name, columns: columns, record: record, indent: indent } ) end |