Remove ActiveAdmin as it's not really working that well with Rails 4 and we still don't really use it.

This commit is contained in:
Señor Rolando 2013-11-01 23:25:05 +01:00
parent e66ea5a201
commit a63163ca85
7 changed files with 0 additions and 292 deletions

View file

@ -1,55 +0,0 @@
class DeviseCreateAdminUsers < ActiveRecord::Migration
def self.up
create_table(:admin_users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""
## Recoverable
t.string :reset_password_token
# t.datetime :reset_password_sent_at
## Rememberable
t.datetime :remember_created_at
## Trackable
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
## Encryptable
# t.string :password_salt
## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable
## Lockable
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at
# Token authenticatable
# t.string :authentication_token
t.timestamps
end
# Create a default user
AdminUser.create!(:email => 'admin@contact-o-rama.com', :password => 'admin.password314', :password_confirmation => 'admin.password314')
add_index :admin_users, :email, :unique => true
add_index :admin_users, :reset_password_token, :unique => true
# add_index :admin_users, :confirmation_token, :unique => true
# add_index :admin_users, :unlock_token, :unique => true
# add_index :admin_users, :authentication_token, :unique => true
end
def self.down
drop_table :admin_users
end
end

View file

@ -1,16 +0,0 @@
class CreateAdminNotes < ActiveRecord::Migration
def self.up
create_table :admin_notes do |t|
t.references :resource, :polymorphic => true, :null => false
t.references :admin_user, :polymorphic => true
t.text :body
t.timestamps
end
add_index :admin_notes, [:resource_type, :resource_id]
add_index :admin_notes, [:admin_user_type, :admin_user_id]
end
def self.down
drop_table :admin_notes
end
end

View file

@ -1,25 +0,0 @@
class MoveAdminNotesToComments < ActiveRecord::Migration
def self.up
remove_index :admin_notes, [:admin_user_type, :admin_user_id]
rename_table :admin_notes, :active_admin_comments
rename_column :active_admin_comments, :admin_user_type, :author_type
rename_column :active_admin_comments, :admin_user_id, :author_id
add_column :active_admin_comments, :namespace, :string
add_index :active_admin_comments, [:namespace]
add_index :active_admin_comments, [:author_type, :author_id]
# Update all the existing comments to the default namespace
say "Updating any existing comments to the #{ActiveAdmin.application.default_namespace} namespace."
execute "UPDATE active_admin_comments SET namespace='#{ActiveAdmin.application.default_namespace}'"
end
def self.down
remove_index :active_admin_comments, :column => [:author_type, :author_id]
remove_index :active_admin_comments, :column => [:namespace]
remove_column :active_admin_comments, :namespace
rename_column :active_admin_comments, :author_id, :admin_user_id
rename_column :active_admin_comments, :author_type, :admin_user_type
rename_table :active_admin_comments, :admin_notes
add_index :admin_notes, [:admin_user_type, :admin_user_id]
end
end