class ActsAsFriendable::Generators::InstallGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/acts_as_friendable/install/install_generator.rb, line 10
def self.next_migration_number(path)
  unless @prev_migration_nr
    @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
  else
    @prev_migration_nr += 1
  end
  @prev_migration_nr.to_s
end

Public Instance Methods

copy_migration() click to toggle source
# File lib/generators/acts_as_friendable/install/install_generator.rb, line 19
def copy_migration
  migration_template 'friendships.rb', 'db/migrate/create_acts_as_friendable_friendships.rb'
end