From 36c005ecd112b76d3c9c2d7092f22d6e06755d73 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Wed, 9 Nov 2011 22:19:07 +1300 Subject: Refactored everything (models, helpers) into proper namespace of Refinery::Blog. Requires refinery commit 25162b585b9c4023d39fd1a9796140bfa4ecb909 --- db/migrate/20110803223522_create_blog_structure.rb | 16 ++++++++-------- db/migrate/20110803223523_add_user_id_to_blog_posts.rb | 2 +- db/migrate/20110803223526_add_cached_slugs.rb | 4 ++-- .../20110803223527_add_custom_url_field_to_blog_posts.rb | 2 +- ...110803223528_add_custom_teaser_field_to_blog_posts.rb | 2 +- db/seeds.rb | 9 ++++++++- 6 files changed, 21 insertions(+), 14 deletions(-) (limited to 'db') diff --git a/db/migrate/20110803223522_create_blog_structure.rb b/db/migrate/20110803223522_create_blog_structure.rb index ee3fe01..f828936 100644 --- a/db/migrate/20110803223522_create_blog_structure.rb +++ b/db/migrate/20110803223522_create_blog_structure.rb @@ -1,7 +1,7 @@ class CreateBlogStructure < ActiveRecord::Migration def up - create_table Refinery::BlogPost.table_name, :id => true do |t| + create_table Refinery::Blog::Post.table_name, :id => true do |t| t.string :title t.text :body t.boolean :draft @@ -9,9 +9,9 @@ class CreateBlogStructure < ActiveRecord::Migration t.timestamps end - add_index Refinery::BlogPost.table_name, :id + add_index Refinery::Blog::Post.table_name, :id - create_table Refinery::BlogComment.table_name, :id => true do |t| + create_table Refinery::Blog::Comment.table_name, :id => true do |t| t.integer :blog_post_id t.boolean :spam t.string :name @@ -21,14 +21,14 @@ class CreateBlogStructure < ActiveRecord::Migration t.timestamps end - add_index Refinery::BlogComment.table_name, :id + add_index Refinery::Blog::Comment.table_name, :id - create_table Refinery::BlogCategory.table_name, :id => true do |t| + create_table Refinery::Blog::Category.table_name, :id => true do |t| t.string :title t.timestamps end - add_index Refinery::BlogCategory.table_name, :id + add_index Refinery::Blog::Category.table_name, :id create_table Refinery::Categorization.table_name, :id => true do |t| t.integer :blog_category_id @@ -43,8 +43,8 @@ class CreateBlogStructure < ActiveRecord::Migration Refinery::Page.delete_all({:link_url => "/blog"}) - drop_table Refinery::BlogPost.table_name - drop_table Refinery::BlogComment.table_name + drop_table Refinery::Blog::Post.table_name + drop_table Refinery::Blog::Comment.table_name drop_table Refinery::Category.table_name drop_table Refinery::Categorization.table_name end diff --git a/db/migrate/20110803223523_add_user_id_to_blog_posts.rb b/db/migrate/20110803223523_add_user_id_to_blog_posts.rb index 5be3224..2fadb28 100644 --- a/db/migrate/20110803223523_add_user_id_to_blog_posts.rb +++ b/db/migrate/20110803223523_add_user_id_to_blog_posts.rb @@ -1,7 +1,7 @@ class AddUserIdToBlogPosts < ActiveRecord::Migration def change - add_column Refinery::BlogPost.table_name, :user_id, :integer + add_column Refinery::Blog::Post.table_name, :user_id, :integer end end \ No newline at end of file diff --git a/db/migrate/20110803223526_add_cached_slugs.rb b/db/migrate/20110803223526_add_cached_slugs.rb index 9e39586..1024323 100644 --- a/db/migrate/20110803223526_add_cached_slugs.rb +++ b/db/migrate/20110803223526_add_cached_slugs.rb @@ -1,6 +1,6 @@ class AddCachedSlugs < ActiveRecord::Migration def change - add_column Refinery::BlogCategory.table_name, :cached_slug, :string - add_column Refinery::BlogPost.table_name, :cached_slug, :string + add_column Refinery::Blog::Category.table_name, :cached_slug, :string + add_column Refinery::Blog::Post.table_name, :cached_slug, :string end end diff --git a/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb b/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb index 22b49a4..7d3a225 100644 --- a/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb +++ b/db/migrate/20110803223527_add_custom_url_field_to_blog_posts.rb @@ -1,5 +1,5 @@ class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration def change - add_column Refinery::BlogPost.table_name, :custom_url, :string + add_column Refinery::Blog::Post.table_name, :custom_url, :string end end diff --git a/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb b/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb index 9c50b97..895acb5 100644 --- a/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb +++ b/db/migrate/20110803223528_add_custom_teaser_field_to_blog_posts.rb @@ -1,6 +1,6 @@ class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration def change - add_column Refinery::BlogPost.table_name, :custom_teaser, :text + add_column Refinery::Blog::Post.table_name, :custom_teaser, :text end end diff --git a/db/seeds.rb b/db/seeds.rb index 19c4370..e0a8b7d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -17,4 +17,11 @@ if defined?(Refinery::Page) Refinery::Page.default_parts.each do |default_page_part| page.parts.create(:title => default_page_part, :body => nil) end -end \ No newline at end of file +end# Refinery seeds +Dir[Rails.root.join('db', 'seeds', '*.rb').to_s].each do |file| + puts "Loading db/seeds/#{file.split(File::SEPARATOR).last}" + load(file) +end + +# Added by RefineryCMS Pages engine +Refinery::Pages::Engine.load_seed -- cgit v1.2.3