Refactored everything (models, helpers) into proper namespace of Refinery::Blog. Requires refinery commit 25162b585b9c4023d39fd1a9796140bfa4ecb909
This commit is contained in:
parent
d18364d359
commit
36c005ecd1
47 changed files with 725 additions and 718 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue