Created
December 15, 2011 22:31
-
-
Save jrallison/1483238 to your computer and use it in GitHub Desktop.
Admin assistant and Rails 3.0.10 issue.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Gemfile b/Gemfile | |
index 861f72a..e63813d 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -5,7 +5,8 @@ gem 'rails', '3.0.10' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
-gem 'sqlite3' | |
+gem 'mysql' | |
+gem 'admin_assistant' | |
# Use unicorn as the web server | |
# gem 'unicorn' | |
diff --git a/app/controllers/admin/blog_posts_controller.rb b/app/controllers/admin/blog_posts_controller.rb | |
new file mode 100644 | |
index 0000000..f3588b2 | |
--- /dev/null | |
+++ b/app/controllers/admin/blog_posts_controller.rb | |
@@ -0,0 +1,6 @@ | |
+class Admin::BlogPostsController < ApplicationController | |
+ layout 'admin' | |
+ | |
+ admin_assistant_for BlogPost do |admin| | |
+ end | |
+end | |
diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb | |
new file mode 100644 | |
index 0000000..e5791ab | |
--- /dev/null | |
+++ b/app/models/blog_post.rb | |
@@ -0,0 +1,2 @@ | |
+class BlogPost < ActiveRecord::Base | |
+end | |
diff --git a/config/database.yml b/config/database.yml | |
index 90d87cc..16c7cf9 100644 | |
--- a/config/database.yml | |
+++ b/config/database.yml | |
@@ -1,8 +1,8 @@ | |
# SQLite version 3.x | |
# gem install sqlite3 | |
development: | |
- adapter: sqlite3 | |
- database: db/development.sqlite3 | |
+ adapter: mysql | |
+ database: admin_assistant_dev | |
pool: 5 | |
timeout: 5000 | |
@@ -10,13 +10,7 @@ development: | |
# re-generated from your development database when you run "rake". | |
# Do not set this db to the same as development or production. | |
test: | |
- adapter: sqlite3 | |
- database: db/test.sqlite3 | |
- pool: 5 | |
- timeout: 5000 | |
- | |
-production: | |
- adapter: sqlite3 | |
- database: db/production.sqlite3 | |
+ adapter: mysql | |
+ database: admin_assistant_test | |
pool: 5 | |
timeout: 5000 | |
diff --git a/db/migrate/20111215220159_create_blog_posts.rb b/db/migrate/20111215220159_create_blog_posts.rb | |
new file mode 100644 | |
index 0000000..71fc2a1 | |
--- /dev/null | |
+++ b/db/migrate/20111215220159_create_blog_posts.rb | |
@@ -0,0 +1,12 @@ | |
+class CreateBlogPosts < ActiveRecord::Migration | |
+ def self.up | |
+ create_table :blog_posts do |t| | |
+ t.string :title | |
+ t.text :body | |
+ end | |
+ end | |
+ | |
+ def self.down | |
+ drop_table :blog_posts | |
+ end | |
+end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result of
rake db:migrate
: