Skip to content
Browse files

Initial upgrade to Rails 3.2/CMS 3.5

  • Loading branch information...
1 parent 2dac3bd commit 277db3da2da8701b3b56127092ff16156523eeb0 @peakpg peakpg committed May 21, 2012
View
2 .gitignore
@@ -5,8 +5,8 @@ db/*.sqlite3
*.gem
.dotest
tmp/restart.txt
-public/cache
.idea/
+test/dummy/.sass-cache
test/dummy/tmp/*
test/dummy/log/*
test/dummy/db/schema.rb
View
2 .rvmrc
@@ -1 +1 @@
-rvm use 1.9.3@rails3.1
+rvm use 1.9.3@r3.2
View
2 Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'
-gem 'browsercms', path: '~/projects/browsercms'
+gem 'browsercms'
gemspec
# Avoids unnecessary Content Length warnings that Rack 1.3.6/Rails 3.1.3 + Webrick throw
View
127 Gemfile.lock
@@ -2,97 +2,112 @@ PATH
remote: .
specs:
bcms_news (1.3.0)
- browsercms (~> 3.4.0)
-
-PATH
- remote: ~/projects/browsercms
- specs:
- browsercms (3.4.0)
- jquery-rails
- rails (~> 3.1.0)
- term-ansicolor
+ browsercms (>= 3.5.0.rc1, < 3.6.0)
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.3)
- actionpack (= 3.1.3)
- mail (~> 2.3.0)
- actionpack (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.5)
- rack-cache (~> 1.1)
- rack-mount (~> 0.8.2)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.3)
- activemodel (3.1.3)
- activesupport (= 3.1.3)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- arel (~> 2.2.1)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.1.3)
- activemodel (= 3.1.3)
- activesupport (= 3.1.3)
- activesupport (3.1.3)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
multi_json (~> 1.0)
- arel (2.2.1)
+ ancestry (1.2.5)
+ activerecord (>= 2.2.2)
+ arel (3.0.2)
+ browsercms (3.5.0.rc1)
+ ancestry (~> 1.2.4)
+ ckeditor_rails (~> 3.6.2.2)
+ jquery-rails (~> 2.0)
+ paperclip (~> 3.0.3)
+ rails (~> 3.2.0)
+ sass-rails
+ term-ansicolor
builder (3.0.0)
+ ckeditor_rails (3.6.2.2)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ cocaine (0.2.1)
daemons (1.1.8)
erubis (2.7.0)
eventmachine (0.12.10)
hike (1.2.1)
i18n (0.6.0)
- jquery-rails (1.0.19)
- railties (~> 3.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
- json (1.6.5)
- mail (2.3.0)
+ json (1.7.3)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
- mime-types (1.17.2)
- mocha (0.10.4)
+ mime-types (1.18)
+ mocha (0.11.4)
metaclass (~> 0.0.1)
- multi_json (1.0.4)
+ multi_json (1.3.5)
mysql (2.8.1)
+ paperclip (3.0.4)
+ activemodel (>= 3.0.0)
+ activerecord (>= 3.0.0)
+ activesupport (>= 3.0.0)
+ cocaine (>= 0.0.2)
+ mime-types
polyglot (0.3.3)
- rack (1.3.6)
- rack-cache (1.1)
+ rack (1.4.1)
+ rack-cache (1.2)
rack (>= 0.4)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
- rails (3.1.3)
- actionmailer (= 3.1.3)
- actionpack (= 3.1.3)
- activerecord (= 3.1.3)
- activeresource (= 3.1.3)
- activesupport (= 3.1.3)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
bundler (~> 1.0)
- railties (= 3.1.3)
- railties (3.1.3)
- actionpack (= 3.1.3)
- activesupport (= 3.1.3)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
- sprockets (2.0.3)
+ sass (3.1.18)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
@@ -106,14 +121,14 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.31)
+ tzinfo (0.3.33)
PLATFORMS
ruby
DEPENDENCIES
bcms_news!
- browsercms!
+ browsercms
mocha
mysql
thin
View
4 app/models/bcms_news/news_article.rb
@@ -1,5 +1,7 @@
class BcmsNews::NewsArticle < ActiveRecord::Base
- acts_as_content_block :belongs_to_attachment => true, :taggable => true
+ acts_as_content_block :taggable => true
+
+ has_attachment :file
belongs_to :category, :class_name=>"Cms::Category"
View
2 app/views/bcms_news/news_articles/_form.html.erb
@@ -3,5 +3,5 @@
<%= f.cms_drop_down :category_id, categories_for('News Article').map{|c| [c.path, c.id]} %>
<%= f.cms_text_area :summary, :style => "height: 100px" %>
<%= f.cms_text_editor :body %>
-<%= f.cms_file_field :attachment_file, :label => "File" %>
+<%= f.cms_file_field :file, :label => "File" %>
<%= f.cms_tag_list %>
View
4 app/views/bcms_news/news_articles/render.html.erb
@@ -1,5 +1,5 @@
<h2><%=h @content_block.name %></h2>
<p><%= @content_block.body.html_safe %></p>
-<% if @content_block.attachment %>
-<%= link_to "Attachment", @content_block.attachment_file_path %>
+<% if @content_block.file %>
+<%= link_to "Attachment", attachment_path_for(@content_block.file) %>
<% end %>
View
2 bcms_news.gemspec
@@ -29,5 +29,5 @@ Gem::Specification.new do |s|
s.rubyforge_project = s.name
- s.add_dependency("browsercms", "~> 3.4.0")
+ s.add_dependency("browsercms", "< 3.6.0", ">= 3.5.0.rc1")
end
View
7 test/dummy/config/initializers/quiet_sprockets_assets.rb
@@ -1,7 +0,0 @@
-Rails.application.assets.logger = Logger.new('/dev/null')
-Rails::Rack::Logger.class_eval do
- def before_dispatch_with_quiet_assets(env)
- before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
- end
- alias_method_chain :before_dispatch, :quiet_assets
-end
View
96 test/dummy/db/migrate/20120521153603_browsercms315.cms.rb
@@ -0,0 +1,96 @@
+# This migration comes from cms (originally 20100117144039)
+class Browsercms315 < ActiveRecord::Migration
+ def self.up
+ generate_ancestry_from_section_id
+ update_latest_version_cache
+
+ INDEXES.each do |index|
+ table, column = *index
+ add_index prefix(table), column
+ end
+ end
+
+ def self.down
+ # This migration is not reversible since it removes the original section_id column.
+ end
+
+ # Add some very commonly used indexes to improve the site performance as the # of pages/content grows (i.e. several thousand pages)
+ INDEXES = [
+ [:pages, :deleted],
+ [:pages, :path],
+ [:pages, :version],
+ [:page_versions, :original_record_id],
+ [:groups, :code],
+ [:groups, :group_type_id],
+ [:group_types, :cms_access],
+ [:group_sections, :section_id],
+ [:group_sections, :group_id],
+ [:users, :expires_at],
+ [:user_group_memberships, :group_id],
+ [:user_group_memberships, :user_id],
+ [:group_permissions, :group_id],
+ [:group_permissions, :permission_id],
+ [:group_permissions, [:group_id, :permission_id]],
+ [:section_nodes, :node_type],
+ [:section_nodes, :ancestry],
+ [:connectors, :page_id],
+ [:connectors, :page_version],
+ [:html_blocks, :deleted],
+ [:html_block_versions, :original_record_id],
+ [:html_block_versions, :version],
+ [:portlet_attributes, :portlet_id],
+ [:portlets, :name],
+ [:sections, :path],
+ [:redirects, :from_path],
+ [:connectors, :connectable_version],
+ [:connectors, :connectable_type],
+ [:content_types, :content_type_group_id],
+ [:content_types, :name],
+ [:file_block_versions, :original_record_id],
+ [:file_block_versions, :version],
+ [:file_blocks, :deleted],
+ [:file_blocks, :type],
+ [:attachment_versions, :original_record_id],
+ [:tasks, :page_id],
+ [:tasks, :completed_at],
+ [:tasks, :assigned_to_id],
+ ]
+
+ private
+
+ # v3.1.5 uses Ancestry to manage the parent child relationship between sections and their children.
+ # This converts the data from the old section_id to use the ancestry column.
+ def self.generate_ancestry_from_section_id
+ add_column prefix(:section_nodes), :ancestry, :string
+ add_column prefix(:section_nodes), :temp_parent_id, :integer
+
+ Cms::SectionNode.reset_column_information
+ root_section = Cms::Section.root.first
+ Cms::SectionNode.create!(:node => root_section) if root_section
+
+ all_nodes_but_root = Cms::SectionNode.find(:all, :conditions=>["section_id IS NOT NULL"])
+ all_nodes_but_root.each do |sn|
+ parent_node = Cms::SectionNode.find(:first, :conditions => ["node_id = ? and node_type = 'Section'", sn.section_id])
+ sn.temp_parent_id = parent_node.id
+ sn.save!
+ end
+ rename_column prefix(:section_nodes), :temp_parent_id, :parent_id # Ancestry works off the 'parent_id' column.
+
+ Cms::SectionNode.build_ancestry_from_parent_ids!
+ remove_column prefix(:section_nodes), :section_id
+ remove_column prefix(:section_nodes), :parent_id
+ Cms::SectionNode.reset_column_information
+ end
+
+ # Adds a 'latest_version' pointer to pages and links. Greatly reduces the number of queries the sitemap requires to determine if pages are in draft/published mode
+ def self.update_latest_version_cache
+ add_column prefix(:pages), :latest_version, :integer
+ add_column prefix(:links), :latest_version, :integer
+ Cms::Page.all.each do |p|
+ p.update_latest_version
+ end
+ Cms::Link.all.each do |link|
+ link.update_latest_version
+ end
+ end
+end
View
33 test/dummy/db/migrate/20120521153604_browsercms350.cms.rb
@@ -0,0 +1,33 @@
+# This migration comes from cms (originally 20120329144406)
+require 'cms/upgrades/v3_5_0'
+
+class Browsercms350 < ActiveRecord::Migration
+ def change
+ migrate_attachments_table
+ migrate_attachment_for(Cms::ImageBlock)
+ migrate_attachment_for(Cms::FileBlock)
+ migrate_attachment_files_to_new_location
+
+ end
+
+
+ private
+
+ def migrate_attachments_table
+ rename_table :attachments, :cms_attachments if table_exists?(:attachments)
+ rename_table :attachment_versions, :cms_attachment_versions if table_exists?(:attachment_versions)
+
+ rename_content_column :cms_attachments, :file_path, :data_file_path
+ rename_content_column :cms_attachments, :file_size, :data_file_size
+ rename_content_column :cms_attachments, :file_type, :data_content_type
+ rename_content_column :cms_attachments, :name, :data_file_name
+ remove_content_column :cms_attachments, :file_extension
+
+ add_content_column :cms_attachments, :data_fingerprint, :string
+ add_content_column :cms_attachments, :attachable_type, :string
+ add_content_column :cms_attachments, :attachment_name, :string
+ add_content_column :cms_attachments, :attachable_id, :integer
+ add_content_column :cms_attachments, :attachable_version, :integer
+ add_content_column :cms_attachments, :cardinality, :string
+ end
+end
View
282 test/dummy/db/schema.rb
@@ -11,44 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120103165543) do
-
- create_table "attachment_versions", :force => true do |t|
- t.integer "original_record_id"
- t.integer "version"
- t.string "file_path"
- t.string "file_location"
- t.string "file_extension"
- t.string "file_type"
- t.integer "file_size"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "name"
- t.boolean "published", :default => false
- t.boolean "deleted", :default => false
- t.boolean "archived", :default => false
- t.string "version_comment"
- t.integer "created_by_id"
- t.integer "updated_by_id"
- end
-
- create_table "attachments", :force => true do |t|
- t.integer "version"
- t.integer "lock_version", :default => 0
- t.string "file_path"
- t.string "file_location"
- t.string "file_extension"
- t.string "file_type"
- t.integer "file_size"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "name"
- t.boolean "published", :default => false
- t.boolean "deleted", :default => false
- t.boolean "archived", :default => false
- t.integer "created_by_id"
- t.integer "updated_by_id"
- end
+ActiveRecord::Schema.define(:version => 20120521153604) do
create_table "bcms_news_news_article_versions", :force => true do |t|
t.integer "original_record_id"
@@ -67,8 +30,8 @@
t.string "version_comment"
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "bcms_news_news_articles", :force => true do |t|
@@ -87,22 +50,71 @@
t.boolean "archived", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "categories", :force => true do |t|
t.integer "category_type_id"
t.integer "parent_id"
t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "category_types", :force => true do |t|
t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "cms_attachment_versions", :force => true do |t|
+ t.integer "original_record_id"
+ t.integer "version"
+ t.string "data_file_path"
+ t.string "file_location"
+ t.string "data_content_type"
+ t.integer "data_file_size"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "data_file_name"
+ t.boolean "published", :default => false
+ t.boolean "deleted", :default => false
+ t.boolean "archived", :default => false
+ t.string "version_comment"
+ t.integer "created_by_id"
+ t.integer "updated_by_id"
+ t.string "data_fingerprint"
+ t.string "attachable_type"
+ t.string "attachment_name"
+ t.integer "attachable_id"
+ t.integer "attachable_version"
+ t.string "cardinality"
+ end
+
+ add_index "cms_attachment_versions", ["original_record_id"], :name => "index_attachment_versions_on_original_record_id"
+
+ create_table "cms_attachments", :force => true do |t|
+ t.integer "version"
+ t.integer "lock_version", :default => 0
+ t.string "data_file_path"
+ t.string "file_location"
+ t.string "data_content_type"
+ t.integer "data_file_size"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "data_file_name"
+ t.boolean "published", :default => false
+ t.boolean "deleted", :default => false
+ t.boolean "archived", :default => false
+ t.integer "created_by_id"
+ t.integer "updated_by_id"
+ t.string "data_fingerprint"
+ t.string "attachable_type"
+ t.string "attachment_name"
+ t.integer "attachable_id"
+ t.integer "attachable_version"
+ t.string "cardinality"
end
create_table "connectors", :force => true do |t|
@@ -113,24 +125,32 @@
t.integer "connectable_version"
t.string "container"
t.integer "position"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "connectors", ["connectable_type"], :name => "index_connectors_on_connectable_type"
+ add_index "connectors", ["connectable_version"], :name => "index_connectors_on_connectable_version"
+ add_index "connectors", ["page_id"], :name => "index_connectors_on_page_id"
+ add_index "connectors", ["page_version"], :name => "index_connectors_on_page_version"
+
create_table "content_type_groups", :force => true do |t|
t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "content_types", :force => true do |t|
t.string "name"
t.integer "content_type_group_id"
t.integer "priority", :default => 2
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "content_types", ["content_type_group_id"], :name => "index_content_types_on_content_type_group_id"
+ add_index "content_types", ["name"], :name => "index_content_types_on_name"
+
create_table "dynamic_view_versions", :force => true do |t|
t.integer "original_record_id"
t.integer "version"
@@ -139,8 +159,8 @@
t.string "format"
t.string "handler"
t.text "body"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "published", :default => false
t.boolean "deleted", :default => false
t.boolean "archived", :default => false
@@ -157,8 +177,8 @@
t.string "format"
t.string "handler"
t.text "body"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "published", :default => false
t.boolean "deleted", :default => false
t.boolean "archived", :default => false
@@ -175,8 +195,8 @@
t.text "body"
t.string "content_type"
t.datetime "delivered_at"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "file_block_versions", :force => true do |t|
@@ -192,10 +212,13 @@
t.string "version_comment"
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "file_block_versions", ["original_record_id"], :name => "index_file_block_versions_on_original_record_id"
+ add_index "file_block_versions", ["version"], :name => "index_file_block_versions_on_version"
+
create_table "file_blocks", :force => true do |t|
t.integer "version"
t.integer "lock_version", :default => 0
@@ -208,20 +231,30 @@
t.boolean "archived", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "file_blocks", ["deleted"], :name => "index_file_blocks_on_deleted"
+ add_index "file_blocks", ["type"], :name => "index_file_blocks_on_type"
+
create_table "group_permissions", :force => true do |t|
t.integer "group_id"
t.integer "permission_id"
end
+ add_index "group_permissions", ["group_id", "permission_id"], :name => "index_group_permissions_on_group_id_and_permission_id"
+ add_index "group_permissions", ["group_id"], :name => "index_group_permissions_on_group_id"
+ add_index "group_permissions", ["permission_id"], :name => "index_group_permissions_on_permission_id"
+
create_table "group_sections", :force => true do |t|
t.integer "group_id"
t.integer "section_id"
end
+ add_index "group_sections", ["group_id"], :name => "index_group_sections_on_group_id"
+ add_index "group_sections", ["section_id"], :name => "index_group_sections_on_section_id"
+
create_table "group_type_permissions", :force => true do |t|
t.integer "group_type_id"
t.integer "permission_id"
@@ -231,18 +264,23 @@
t.string "name"
t.boolean "guest", :default => false
t.boolean "cms_access", :default => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "group_types", ["cms_access"], :name => "index_group_types_on_cms_access"
+
create_table "groups", :force => true do |t|
t.string "name"
t.string "code"
t.integer "group_type_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "groups", ["code"], :name => "index_groups_on_code"
+ add_index "groups", ["group_type_id"], :name => "index_groups_on_group_type_id"
+
create_table "html_block_versions", :force => true do |t|
t.integer "original_record_id"
t.integer "version"
@@ -254,10 +292,13 @@
t.string "version_comment"
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "html_block_versions", ["original_record_id"], :name => "index_html_block_versions_on_original_record_id"
+ add_index "html_block_versions", ["version"], :name => "index_html_block_versions_on_version"
+
create_table "html_blocks", :force => true do |t|
t.integer "version"
t.integer "lock_version", :default => 0
@@ -268,18 +309,20 @@
t.boolean "archived", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "html_blocks", ["deleted"], :name => "index_html_blocks_on_deleted"
+
create_table "link_versions", :force => true do |t|
t.integer "original_record_id"
t.integer "version"
t.string "name"
t.string "url"
t.boolean "new_window", :default => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
t.boolean "published", :default => false
t.boolean "deleted", :default => false
t.boolean "archived", :default => false
@@ -290,35 +333,36 @@
create_table "links", :force => true do |t|
t.integer "version"
- t.integer "lock_version", :default => 0
+ t.integer "lock_version", :default => 0
t.string "name"
t.string "url"
- t.boolean "new_window", :default => false
- t.datetime "created_at"
- t.datetime "updated_at"
- t.boolean "published", :default => false
- t.boolean "deleted", :default => false
- t.boolean "archived", :default => false
+ t.boolean "new_window", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "published", :default => false
+ t.boolean "deleted", :default => false
+ t.boolean "archived", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
+ t.integer "latest_version"
end
create_table "page_route_options", :force => true do |t|
t.integer "page_route_id"
t.string "type"
t.string "name"
t.string "value"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "page_routes", :force => true do |t|
t.string "name"
t.string "pattern"
t.integer "page_id"
t.text "code"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "page_versions", :force => true do |t|
@@ -339,10 +383,12 @@
t.string "version_comment"
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "page_versions", ["original_record_id"], :name => "index_page_versions_on_original_record_id"
+
create_table "pages", :force => true do |t|
t.integer "version"
t.integer "lock_version", :default => 0
@@ -360,17 +406,22 @@
t.boolean "archived", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "latest_version"
end
+ add_index "pages", ["deleted"], :name => "index_pages_on_deleted"
+ add_index "pages", ["path"], :name => "index_pages_on_path"
+ add_index "pages", ["version"], :name => "index_pages_on_version"
+
create_table "permissions", :force => true do |t|
t.string "name"
t.string "full_name"
t.string "description"
t.string "for_module"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "portlet_attributes", :force => true do |t|
@@ -379,63 +430,74 @@
t.text "value"
end
+ add_index "portlet_attributes", ["portlet_id"], :name => "index_portlet_attributes_on_portlet_id"
+
create_table "portlets", :force => true do |t|
t.string "type"
t.string "name"
t.boolean "archived", :default => false
t.boolean "deleted", :default => false
t.integer "created_by_id"
t.integer "updated_by_id"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "portlets", ["name"], :name => "index_portlets_on_name"
+
create_table "redirects", :force => true do |t|
t.string "from_path"
t.string "to_path"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "redirects", ["from_path"], :name => "index_redirects_on_from_path"
+
create_table "section_nodes", :force => true do |t|
- t.integer "section_id"
t.string "node_type"
t.integer "node_id"
t.integer "position"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "ancestry"
end
+ add_index "section_nodes", ["ancestry"], :name => "index_section_nodes_on_ancestry"
+ add_index "section_nodes", ["node_type"], :name => "index_section_nodes_on_node_type"
+
create_table "sections", :force => true do |t|
t.string "name"
t.string "path"
t.boolean "root", :default => false
t.boolean "hidden", :default => false
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "sections", ["path"], :name => "index_sections_on_path"
+
create_table "sites", :force => true do |t|
t.string "name"
t.string "domain"
t.boolean "the_default"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "taggable_id"
t.string "taggable_type"
t.integer "taggable_version"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "tags", :force => true do |t|
t.string "name"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "tasks", :force => true do |t|
@@ -445,15 +507,22 @@
t.text "comment"
t.date "due_date"
t.datetime "completed_at"
- t.datetime "created_at"
- t.datetime "updated_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
+ add_index "tasks", ["assigned_to_id"], :name => "index_tasks_on_assigned_to_id"
+ add_index "tasks", ["completed_at"], :name => "index_tasks_on_completed_at"
+ add_index "tasks", ["page_id"], :name => "index_tasks_on_page_id"
+
create_table "user_group_memberships", :force => true do |t|
t.integer "user_id"
t.integer "group_id"
end
+ add_index "user_group_memberships", ["group_id"], :name => "index_user_group_memberships_on_group_id"
+ add_index "user_group_memberships", ["user_id"], :name => "index_user_group_memberships_on_user_id"
+
create_table "users", :force => true do |t|
t.string "login", :limit => 40
t.string "first_name", :limit => 40
@@ -469,6 +538,7 @@
t.string "reset_token"
end
+ add_index "users", ["expires_at"], :name => "index_users_on_expires_at"
add_index "users", ["login"], :name => "index_users_on_login", :unique => true
end
View
3 test/integration/news_articles_test.rb
@@ -15,7 +15,8 @@ def setup
get "/bcms_news/articles/feed"
assert_response :success, "What the heck is a 406 response code?"
- assert_select "rss"
+ assert @response.body.include?("<rss")
+ # Checking vs @response.body rather than using assert_select since the later throws invalid warnings when parsing XML
end
end
View
5 test/unit/recent_news_portlet_test.rb
@@ -28,8 +28,9 @@ def test_finds_all_articles
def test_looks_up_articles_based_on_category_id
c_type = Cms::CategoryType.create!(:name => "News")
- c = Cms::Category.create!(:name => "Category A", :category_type => c_type)
- @article_in_category = Factory(:article, :category => c)
+ assert_equal true, c_type.persisted?
+ c = Cms::Category.create!(:name => "Category A", :category_type_id => c_type.id)
+ @article_in_category = Factory(:article, :category_id => c.id)
p = RecentNewsPortlet.new

0 comments on commit 277db3d

Please sign in to comment.
Something went wrong with that request. Please try again.