class ActiveRecord::Generators::DeviseGuestsGenerator
Public Instance Methods
copy_devise_migration()
click to toggle source
# File lib/generators/active_record/devise_guests_generator.rb, line 10 def copy_devise_migration migration_template "migration_existing.rb", "db/migrate/add_devise_guests_to_#{table_name}.rb", migration_version: migration_version end
migration_data()
click to toggle source
# File lib/generators/active_record/devise_guests_generator.rb, line 16 def migration_data <<RUBY ## Database authenticatable t.boolean :guest, :default => false RUBY end
migration_version()
click to toggle source
# File lib/generators/active_record/devise_guests_generator.rb, line 27 def migration_version return if rails4? "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" end
rails4?()
click to toggle source
# File lib/generators/active_record/devise_guests_generator.rb, line 23 def rails4? Rails.version.start_with? '4' end