Class: FulltextRowsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/fulltext_rows_generator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*runtime_args) ⇒ FulltextRowsGenerator

Returns a new instance of FulltextRowsGenerator.



12
13
14
15
# File 'lib/generators/fulltext_rows_generator.rb', line 12

def initialize(*runtime_args)
  super(*runtime_args)
  #puts @models.to_json
end

Instance Attribute Details

#modelsObject

Returns the value of attribute models.



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

def models
  @models
end

Class Method Details

.next_migration_number(path) ⇒ Object



22
23
24
# File 'lib/generators/fulltext_rows_generator.rb', line 22

def self.next_migration_number(path)
  @migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s
end

Instance Method Details

#create_model_migrationsObject



17
18
19
20
# File 'lib/generators/fulltext_rows_generator.rb', line 17

def create_model_migrations
  migration_template("migrate.rb", 'db/migrate/create_fulltext_rows.rb')

end