Class: ActiveRecord::Generators::ModelGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/active_record.rb

Instance Method Summary collapse

Instance Method Details

#append_schema_fileObject



12
13
14
15
# File 'lib/core_ext/active_record.rb', line 12

def append_schema_file
  attributes.each { |a| a.attr_options.delete(:index) if a.reference? && !a.has_index? } if options[:indexes] == false
  append_file schema_file, schema_template(File.expand_path('../templates/schemafile.rb', __dir__)), { verbose: false }
end