Class: Cubic::Generator::Migrations
- Defined in:
- lib/cubic/generators/migrations.rb
Overview
Generates the migrations for columns and rows attached to a model.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#design(name, options) ⇒ Object
Creates a hash that will be used for file generation purposes.
Methods inherited from Base
#callback, #generate, #initialize
Constructor Details
This class inherits a constructor from Cubic::Generator::Base
Instance Method Details
#design(name, options) ⇒ Object
Creates a hash that will be used for file generation purposes
7 8 9 10 11 12 13 14 |
# File 'lib/cubic/generators/migrations.rb', line 7 def design(name, ) @files << { name: "create_#{name}.rb", path: '/db/migrations/', content: "DB.create_table :#{name.to_s.concat('s')} do primary_key :id #{pair()} end" } end |