1 class SqlSessionStoreGenerator < Rails::Generator::NamedBase
2 def initialize(runtime_args, runtime_options = {})
3 runtime_args.insert(0, 'add_sql_session')
4 if runtime_args.include?('postgresql')
5 @_database = 'postgresql'
6 elsif runtime_args.include?('mysql')
8 elsif runtime_args.include?('oracle')
11 puts "error: database type not given.\nvalid arguments are: mysql or postgresql"
19 m.migration_template("migration.rb", 'db/migrate',
20 :assigns => { :migration_name => "SqlSessionStoreSetup", :database => @_database },
21 :migration_file_name => "sql_session_store_setup"