view .svn/pristine/a3/a3ed448d757e220de4341bd91f2f5821597a92fc.svn-base @ 1119:22d81bd0b62c redmine-2.2-integration

Deleted existing the embedded plugin and replaced it witgh redmine_embedded (same functionality, but upgraded to be compatible with Redmine 2.x).
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 08 Jan 2013 14:43:04 +0000
parents cbb26bc654de
children
line wrap: on
line source
namespace :open_id_authentication do
  namespace :db do
    desc "Creates authentication tables for use with OpenIdAuthentication"
    task :create => :environment do
      generate_migration(["open_id_authentication_tables", "add_open_id_authentication_tables"])
    end

    desc "Upgrade authentication tables from ruby-openid 1.x.x to 2.x.x"
    task :upgrade => :environment do
      generate_migration(["upgrade_open_id_authentication_tables", "upgrade_open_id_authentication_tables"])
    end

    def generate_migration(args)
      require 'rails_generator'
      require 'rails_generator/scripts/generate'

      if ActiveRecord::Base.connection.supports_migrations?
        Rails::Generator::Scripts::Generate.new.run(args)
      else
        raise "Task unavailable to this database (no migration support)"
      end
    end

    desc "Clear the authentication tables"
    task :clear => :environment do
      OpenIdAuthentication::DbStore.cleanup_nonces
      OpenIdAuthentication::DbStore.cleanup_associations
    end
  end
end