Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: c0f828ca4f
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.699 kB
require 'generators/active_record'
module ActiveRecord
module Generators
class SessionMigrationGenerator < Base
argument :name, :type => :string, :default => "add_sessions_table"
def create_migration_file
migration_template "migration.rb", "db/migrate/#{file_name}.rb"
end
protected
def session_table_name
current_table_name = ActiveRecord::SessionStore::Session.table_name
if current_table_name == "sessions" || current_table_name == "session"
current_table_name = (ActiveRecord::Base.pluralize_table_names ? 'session'.pluralize : 'session')
end
current_table_name
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.