Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5ea6b0df9a
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.685 kb
require 'rails/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.in?(["sessions", "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.