Class: ABTesterGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ABTesterGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/rails/generators/a_b_tester/a_b_tester_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
:nodoc:
10 11 12 13 14 15 16 17 18 |
# File 'lib/rails/generators/a_b_tester/a_b_tester_generator.rb', line 10 def self.next_migration_number(dirname) #:nodoc: migration_number_attempt = Time.now.utc.strftime("%Y%m%d%H%M%S") if ActiveRecord::Base. && migration_number_attempt > current_migration_number(dirname).to_s migration_number_attempt else serial_migration_number(dirname) end end |
.source_root ⇒ Object
6 7 8 |
# File 'lib/rails/generators/a_b_tester/a_b_tester_generator.rb', line 6 def self.source_root File.join(File.dirname(__FILE__), 'templates') end |
Instance Method Details
#copy_migration ⇒ Object
20 21 22 |
# File 'lib/rails/generators/a_b_tester/a_b_tester_generator.rb', line 20 def copy_migration migration_template 'create_ab_choices.rb', 'db/migrate/create_ab_choices.rb' end |