class DeviseSuspendableGenerator
Public Class Methods
next_migration_number(dirname)
click to toggle source
# File lib/generators/devise_suspendable/devise_suspendable_generator.rb, line 14 def self.next_migration_number(dirname) if ActiveRecord::Base.timestamped_migrations Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end
orm_has_migration?()
click to toggle source
# File lib/generators/devise_suspendable/devise_suspendable_generator.rb, line 10 def self.orm_has_migration? Rails::Generators.options[:rails][:orm] == :active_record end
source_root()
click to toggle source
# File lib/generators/devise_suspendable/devise_suspendable_generator.rb, line 6 def self.source_root @_devise_source_root ||= File.expand_path("../templates", __FILE__) end
Public Instance Methods
create_migration_file()
click to toggle source
# File lib/generators/devise_suspendable/devise_suspendable_generator.rb, line 26 def create_migration_file migration_template 'migration.rb', "db/migrate/devise_add_suspendable_#{name.downcase}.rb" end