Updated to latest refinerycms(-blog)
* bundle update * new migrations * fixed specs for new behaviour
This commit is contained in:
11
spec/dummy/db/migrate/20110812162202_add_cached_slugs.rb
Normal file
11
spec/dummy/db/migrate/20110812162202_add_cached_slugs.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddCachedSlugs < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_categories, :cached_slug, :string
|
||||
add_column :blog_posts, :cached_slug, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_categories, :cached_slug
|
||||
remove_column :blog_posts, :cached_slug
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddCustomUrlFieldToBlogPosts < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_posts, :custom_url, :string
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_posts, :custom_url
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
class AddCustomTeaserFieldToBlogPosts < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :blog_posts, :custom_teaser, :text
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :blog_posts, :custom_teaser
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,12 +10,13 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20110602094445) do
|
||||
ActiveRecord::Schema.define(:version => 20110812162204) do
|
||||
|
||||
create_table "blog_categories", :force => true do |t|
|
||||
t.string "title"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "cached_slug"
|
||||
end
|
||||
|
||||
add_index "blog_categories", ["id"], :name => "index_blog_categories_on_id"
|
||||
@@ -48,6 +49,9 @@ ActiveRecord::Schema.define(:version => 20110602094445) do
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "user_id"
|
||||
t.string "cached_slug"
|
||||
t.string "custom_url"
|
||||
t.text "custom_teaser"
|
||||
end
|
||||
|
||||
add_index "blog_posts", ["id"], :name => "index_blog_posts_on_id"
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
::Page.reset_column_information
|
||||
# Check whether all columns are applied yet by seo_meta.
|
||||
unless !defined?(::SeoMeta) || ::SeoMeta.attributes.keys.all? { |k|
|
||||
::Page.translation_class.instance_methods.include?(k)
|
||||
}
|
||||
# Make pages model seo_meta because not all columns are accessible.
|
||||
::Page.translation_class.send :is_seo_meta
|
||||
end
|
||||
|
||||
page_position = -1
|
||||
|
||||
home_page = Page.create(:title => "Home",
|
||||
|
||||
Reference in New Issue
Block a user