Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

CMS v3.5.x compatible

  • Loading branch information...
commit 603c4693e9c815d8e68ee7d85ecb28bcfa6c1c52 1 parent a5da4fd
@peakpg peakpg authored
Showing with 18,082 additions and 308 deletions.
  1. +4 −1 .gitignore
  2. +1 −1  .rvmrc
  3. +1 −1  Gemfile
  4. +36 −6 Rakefile
  5. 0  app/assets/images/bcms_google_mini_search/.gitkeep
  6. +15 −0 app/assets/javascripts/bcms_google_mini_search/application.js
  7. +13 −0 app/assets/stylesheets/bcms_google_mini_search/application.css
  8. +4 −0 app/controllers/bcms_google_mini_search/application_controller.rb
  9. +4 −0 app/helpers/bcms_google_mini_search/application_helper.rb
  10. +1 −1  app/portlets/google_mini_search_engine_portlet.rb
  11. +1 −1  app/portlets/search_box_portlet.rb
  12. +0 −17 app/views/layouts/templates/default.html.erb.html.erb
  13. +1 −1  app/views/portlets/google_mini_search_engine/render.html.erb
  14. +1 −1  app/views/portlets/search_box/render.html.erb
  15. +10 −11 bcms_google_mini_search.gemspec
  16. +0 −14 config/boot.rb
  17. +1 −61 config/routes.rb
  18. +0 −9 db/migrate/20091109175123_browsercms_3_0_5.rb
  19. +4 −0 lib/tasks/bcms_google_mini_search_tasks.rake
  20. +5 −0 release_notes.txt
  21. +5 −3 script/rails
  22. +7 −0 test/bcms_google_mini_search_test.rb
  23. +261 −0 test/dummy/README.rdoc
  24. +7 −0 test/dummy/Rakefile
  25. +15 −0 test/dummy/app/assets/javascripts/application.js
  26. +13 −0 test/dummy/app/assets/stylesheets/application.css
  27. 0  { → test/dummy}/app/controllers/application_controller.rb
  28. 0  { → test/dummy}/app/helpers/application_helper.rb
  29. 0  test/dummy/app/mailers/.gitkeep
  30. 0  test/dummy/app/models/.gitkeep
  31. +14 −0 test/dummy/app/views/layouts/application.html.erb
  32. 0  { → test/dummy}/app/views/layouts/templates/default.html.erb
  33. +1 −1  { → test/dummy}/config.ru
  34. +21 −10 { → test/dummy}/config/application.rb
  35. +10 −0 test/dummy/config/boot.rb
  36. 0  { → test/dummy}/config/database.yml
  37. +1 −1  { → test/dummy}/config/environment.rb
  38. +16 −5 { → test/dummy}/config/environments/development.rb
  39. +32 −14 { → test/dummy}/config/environments/production.rb
  40. +10 −8 { → test/dummy}/config/environments/test.rb
  41. 0  { → test/dummy}/config/initializers/backtrace_silencers.rb
  42. +5 −0 { → test/dummy}/config/initializers/inflections.rb
  43. 0  { → test/dummy}/config/initializers/mime_types.rb
  44. +1 −1  { → test/dummy}/config/initializers/secret_token.rb
  45. +2 −2 { → test/dummy}/config/initializers/session_store.rb
  46. +14 −0 test/dummy/config/initializers/wrap_parameters.rb
  47. +1 −1  { → test/dummy}/config/locales/en.yml
  48. +5 −0 test/dummy/config/routes.rb
  49. +20 −13 db/seeds.rb → test/dummy/db/browsercms.seeds.rb
  50. +69 −76 db/migrate/20080815014337_browsercms_3_0_0.rb → test/dummy/db/migrate/20120522154056_browsercms300.cms.rb
  51. +10 −0 test/dummy/db/migrate/20120522154057_browsercms305.cms.rb
  52. +23 −21 db/migrate/20100117144039_browsercms315.rb → test/dummy/db/migrate/20120522154058_browsercms315.cms.rb
  53. +6 −5 db/migrate/20100705083859_browsercms_3_3_0.rb → test/dummy/db/migrate/20120522154059_browsercms330.cms.rb
  54. +63 −0 test/dummy/db/migrate/20120522154060_browsercms340.cms.rb
  55. +33 −0 test/dummy/db/migrate/20120522154061_browsercms350.cms.rb
  56. +503 −0 test/dummy/db/schema.rb
  57. +2 −0  test/dummy/db/seeds.rb
  58. 0  test/dummy/lib/assets/.gitkeep
  59. 0  test/dummy/log/.gitkeep
  60. +16,545 −0 test/dummy/log/development.log
  61. +172 −0 test/dummy/log/test.log
  62. +26 −0 test/dummy/public/404.html
  63. +26 −0 test/dummy/public/422.html
  64. +25 −0 test/dummy/public/500.html
  65. 0  test/dummy/public/favicon.ico
  66. +6 −0 test/dummy/script/rails
  67. +0 −9 test/performance/browsing_test.rb
  68. +10 −13 test/test_helper.rb
View
5 .gitignore
@@ -9,4 +9,7 @@ db/schema.rb
tmp/restart.txt
public/cache
.idea/*
-Gemfile.lock
+Gemfile.lock
+test/dummy/.sass-cache
+test/dummy/public/cache
+test/dummy/tmp/cache
View
2  .rvmrc
@@ -1 +1 @@
-rvm use 1.9.2@rails3.0
+rvm use 1.9.3@r3.2
View
2  Gemfile
@@ -2,6 +2,6 @@ source 'http://rubygems.org'
gemspec
-gem "mysql2", '0.2.18'
+gem "mysql2"
gem "mocha", '0.9.12', :group => :test, :require=>false
View
42 Rakefile
@@ -1,10 +1,40 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
+begin
+ require 'rdoc/task'
+rescue LoadError
+ require 'rdoc/rdoc'
+ require 'rake/rdoctask'
+ RDoc::Task = Rake::RDocTask
+end
+
+RDoc::Task.new(:rdoc) do |rdoc|
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = 'BcmsGoogleMiniSearch'
+ rdoc.options << '--line-numbers'
+ rdoc.rdoc_files.include('README.rdoc')
+ rdoc.rdoc_files.include('lib/**/*.rb')
+end
+
+APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
+load 'rails/tasks/engine.rake'
-require File.expand_path('../config/application', __FILE__)
-require 'rake'
-BcmsGoogleMiniSearch::Application.load_tasks
-require 'bundler'
Bundler::GemHelper.install_tasks
+
+require 'rake/testtask'
+
+Rake::TestTask.new(:test) do |t|
+ t.libs << 'lib'
+ t.libs << 'test'
+ t.pattern = 'test/**/*_test.rb'
+ t.verbose = false
+end
+
+
+task :default => :test
View
0  app/assets/images/bcms_google_mini_search/.gitkeep
No changes.
View
15 app/assets/javascripts/bcms_google_mini_search/application.js
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
View
13 app/assets/stylesheets/bcms_google_mini_search/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+*/
View
4 app/controllers/bcms_google_mini_search/application_controller.rb
@@ -0,0 +1,4 @@
+module BcmsGoogleMiniSearch
+ class ApplicationController < ActionController::Base
+ end
+end
View
4 app/helpers/bcms_google_mini_search/application_helper.rb
@@ -0,0 +1,4 @@
+module BcmsGoogleMiniSearch
+ module ApplicationHelper
+ end
+end
View
2  app/portlets/google_mini_search_engine_portlet.rb
@@ -1,4 +1,4 @@
-class GoogleMiniSearchEnginePortlet < Portlet
+class GoogleMiniSearchEnginePortlet < Cms::Portlet
enable_template_editor true
View
2  app/portlets/search_box_portlet.rb
@@ -1,4 +1,4 @@
-class SearchBoxPortlet < Portlet
+class SearchBoxPortlet < Cms::Portlet
def render
@search_engine = GoogleMiniSearchEnginePortlet.find_by_name(@portlet.search_engine_name)
View
17 app/views/layouts/templates/default.html.erb.html.erb
@@ -1,17 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <title><%= page_title %></title>
- <%= yield :html_head %>
- </head>
- <body style="margin: 0; padding: 0; text-align: center;">
- <%= cms_toolbar %>
- <div id="wrapper" style="width: 700px; margin: 0 auto; text-align: left; padding: 30px">
- Breadcrumbs: <%= render_breadcrumbs %>
- Main Menu: <%= render_menu %>
- <h1><%= page_title %></h1>
- <%= container :main %>
- </div>
- </body>
-</html>
View
2  app/views/portlets/google_mini_search_engine/render.html.erb
@@ -24,7 +24,7 @@ For '<%= @results.query %>', found <%= @results.results_count %> results. <br/>
<ul class="search_results">
<% @results.each do |result|%>
<li>
- <%= result.number %> <%= link_to result.title, result.url, :class=>"search_result_title" %><br />
+ <%= result.number %> <%= link_to result.title.try(:html_safe), result.url, :class=>"search_result_title" %><br />
<span class="search_result_description"><%= result.description.try(:html_safe) %></span> <br />
<span class="search_result_url"><%= result.url %></span> -
<span class="search_result_size"><%= result.size %></span>
View
2  app/views/portlets/search_box/render.html.erb
@@ -1,4 +1,4 @@
-<% form_tag @search_engine.path, :method=>'GET' do %>
+<%= form_tag @search_engine.path, :method=>'GET' do %>
<%= text_field_tag 'query', params[:query] %>
<%= submit_tag 'Go' %>
<% end %>
View
21 bcms_google_mini_search.gemspec
@@ -14,20 +14,19 @@ Gem::Specification.new do |s|
"README.markdown"
]
s.rdoc_options = ["--charset=UTF-8"]
- s.rubyforge_project = "bcms_google_mini_search"
+ s.rubyforge_project = s.name
- s.files = `git ls-files`.split("\n")
- # Exclude files required for the 'dummy' Rails app
- s.files -= Dir['config/**/*', 'public/**/*', 'config.ru', 'db/**/*', 'script/**/*',
- 'app/controllers/application_controller.rb',
- 'app/helpers/application_helper.rb',
- 'app/layouts/templates/**/*'
+ s.files = Dir["{app,config,db,lib}/**/*"]
+ s.files += Dir["app/**/*"]
+ s.files += Dir["config/**/*"]
+ s.files += Dir["db/**/*"]
+ s.files += Dir["lib/**/*"]
+ s.files += Dir["Gemfile", "LICENSE.txt", "COPYRIGHT.txt", "GPL.txt", "release_notes.txt" ]
- ]
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.test_files += Dir["test/**/*"]
+ s.test_files -= Dir['test/dummy/**/*']
s.require_paths = ["lib"]
- s.add_dependency(%q<browsercms>, ["~> 3.3.0"])
+ s.add_dependency("browsercms", "< 3.6.0", ">= 3.5.0.rc2")
end
View
14 config/boot.rb
@@ -1,14 +0,0 @@
-require 'rubygems'
-
-# Set up gems listed in the Gemfile.
-gemfile = File.expand_path('../../Gemfile', __FILE__)
-begin
- ENV['BUNDLE_GEMFILE'] = gemfile
- require 'bundler'
- Bundler.setup
-rescue Bundler::GemNotFound => e
- STDERR.puts e.message
- STDERR.puts "Try running `bundle install`."
- exit!
-end if File.exist?(gemfile)
-
View
62 config/routes.rb
@@ -1,62 +1,2 @@
-BcmsGoogleMiniSearch::Application.routes.draw do
- routes_for_bcms_google_mini_search
-
- routes_for_browser_cms
-
- # The priority is based upon order of creation:
- # first created -> highest priority.
-
- # Sample of regular route:
- # match 'products/:id' => 'catalog#view'
- # Keep in mind you can assign values other than :controller and :action
-
- # Sample of named route:
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
- # This route can be invoked with purchase_url(:id => product.id)
-
- # Sample resource route (maps HTTP verbs to controller actions automatically):
- # resources :products
-
- # Sample resource route with options:
- # resources :products do
- # member do
- # get 'short'
- # post 'toggle'
- # end
- #
- # collection do
- # get 'sold'
- # end
- # end
-
- # Sample resource route with sub-resources:
- # resources :products do
- # resources :comments, :sales
- # resource :seller
- # end
-
- # Sample resource route with more complex sub-resources
- # resources :products do
- # resources :comments
- # resources :sales do
- # get 'recent', :on => :collection
- # end
- # end
-
- # Sample resource route within a namespace:
- # namespace :admin do
- # # Directs /admin/products/* to Admin::ProductsController
- # # (app/controllers/admin/products_controller.rb)
- # resources :products
- # end
-
- # You can have the root of your site routed with "root"
- # just remember to delete public/index.html.
- # root :to => "welcome#index"
-
- # See how all your routes lay out with "rake routes"
-
- # This is a legacy wild controller route that's not recommended for RESTful applications.
- # Note: This route will make all actions in every controller accessible via GET requests.
- # match ':controller(/:action(/:id(.:format)))'
+BcmsGoogleMiniSearch::Engine.routes.draw do
end
View
9 db/migrate/20091109175123_browsercms_3_0_5.rb
@@ -1,9 +0,0 @@
-class Browsercms305 < ActiveRecord::Migration
- def self.up
- add_column :users, :reset_token, :string
- end
-
- def self.down
- remove_column :users, :reset_token
- end
-end
View
4 lib/tasks/bcms_google_mini_search_tasks.rake
@@ -0,0 +1,4 @@
+# desc "Explaining what the task does"
+# task :bcms_google_mini_search do
+# # Task goes here
+# end
View
5 release_notes.txt
@@ -1,3 +1,8 @@
+v1.4.0
+======
+
+* Make compatible with CMS v3.5.x
+
v1.3.1
======
View
8 script/rails
@@ -1,6 +1,8 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-APP_PATH = File.expand_path('../../config/application', __FILE__)
-require File.expand_path('../../config/boot', __FILE__)
-require 'rails/commands'
+ENGINE_ROOT = File.expand_path('../..', __FILE__)
+ENGINE_PATH = File.expand_path('../../lib/bcms_google_mini_search/engine', __FILE__)
+
+require 'rails/all'
+require 'rails/engine/commands'
View
7 test/bcms_google_mini_search_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class BcmsGoogleMiniSearchTest < ActiveSupport::TestCase
+ test "truth" do
+ assert_kind_of Module, BcmsGoogleMiniSearch
+ end
+end
View
261 test/dummy/README.rdoc
@@ -0,0 +1,261 @@
+== Welcome to Rails
+
+Rails is a web-application framework that includes everything needed to create
+database-backed web applications according to the Model-View-Control pattern.
+
+This pattern splits the view (also called the presentation) into "dumb"
+templates that are primarily responsible for inserting pre-built data in between
+HTML tags. The model contains the "smart" domain objects (such as Account,
+Product, Person, Post) that holds all the business logic and knows how to
+persist themselves to a database. The controller handles the incoming requests
+(such as Save New Account, Update Product, Show Post) by manipulating the model
+and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting Started
+
+1. At the command prompt, create a new Rails application:
+ <tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
+
+2. Change directory to <tt>myapp</tt> and start the web server:
+ <tt>cd myapp; rails server</tt> (run with --help for options)
+
+3. Go to http://localhost:3000/ and you'll see:
+ "Welcome aboard: You're riding Ruby on Rails!"
+
+4. Follow the guidelines to start developing your application. You can find
+the following resources handy:
+
+* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
+* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands
+running on the server.log and development.log. Rails will automatically display
+debugging and runtime information to these files. Debugging info will also be
+shown in the browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code
+using the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
+several books available online as well:
+
+* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two books will bring you up to speed on the Ruby language and also on
+programming in general.
+
+
+== Debugger
+
+Debugger support is available through the debugger command when you start your
+Mongrel or WEBrick server with --debugger. This means that you can break out of
+execution at any point in the code, investigate and change the model, and then,
+resume execution! You need to install ruby-debug to run the server in debugging
+mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.all
+ debugger
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the server window. Here you can do things like:
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8
+ @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
+ #<Post:0x14a6620
+ @attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
+ >> @posts.first.title = "hello from a debugger"
+ => "hello from a debugger"
+
+...and even better, you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you can enter "cont".
+
+
+== Console
+
+The console is a Ruby shell, which allows you to interact with your
+application's domain model. Here you'll have all parts of the application
+configured, just like it is when the application is running. You can inspect
+domain models, change values, and save to the database. Starting the script
+without arguments will launch it in the development environment.
+
+To start the console, run <tt>rails console</tt> from the application
+directory.
+
+Options:
+
+* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
+ made to the database.
+* Passing an environment name as an argument will load the corresponding
+ environment. Example: <tt>rails console production</tt>.
+
+To reload your controllers and models after launching the console run
+<tt>reload!</tt>
+
+More information about irb can be found at:
+link:http://www.rubycentral.org/pickaxe/irb.html
+
+
+== dbconsole
+
+You can go to the command line of your database directly through <tt>rails
+dbconsole</tt>. You would be connected to the database with the credentials
+defined in database.yml. Starting the script without arguments will connect you
+to the development database. Passing an argument will connect you to a different
+database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
+PostgreSQL and SQLite 3.
+
+== Description of Contents
+
+The default directory structure of a generated Ruby on Rails application:
+
+ |-- app
+ | |-- assets
+ | |-- images
+ | |-- javascripts
+ | `-- stylesheets
+ | |-- controllers
+ | |-- helpers
+ | |-- mailers
+ | |-- models
+ | `-- views
+ | `-- layouts
+ |-- config
+ | |-- environments
+ | |-- initializers
+ | `-- locales
+ |-- db
+ |-- doc
+ |-- lib
+ | `-- tasks
+ |-- log
+ |-- public
+ |-- script
+ |-- test
+ | |-- fixtures
+ | |-- functional
+ | |-- integration
+ | |-- performance
+ | `-- unit
+ |-- tmp
+ | |-- cache
+ | |-- pids
+ | |-- sessions
+ | `-- sockets
+ `-- vendor
+ |-- assets
+ `-- stylesheets
+ `-- plugins
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/assets
+ Contains subdirectories for images, stylesheets, and JavaScript files.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from
+ ApplicationController which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb. Models descend from
+ ActiveRecord::Base by default.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.html.erb for the WeblogsController#index action. All views use
+ eRuby syntax by default.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the
+ common header/footer method of wrapping views. In your views, define a layout
+ using the <tt>layout :default</tt> and create a file named default.html.erb.
+ Inside default.html.erb, call <% yield %> to render the view using this
+ layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are
+ generated for you automatically when using generators for controllers.
+ Helpers can be used to wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database,
+ and other dependencies.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all the
+ sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when
+ generated using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that
+ doesn't belong under controllers, models, or helpers. This directory is in
+ the load path.
+
+public
+ The directory available for the web server. Also contains the dispatchers and the
+ default HTML files. This should be set as the DOCUMENT_ROOT of your web
+ server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the rails generate
+ command, template test files will be generated for you and placed in this
+ directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins
+ subdirectory. If the app has frozen rails, those gems also go here, under
+ vendor/rails/. This directory is in the load path.
View
7 test/dummy/Rakefile
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Dummy::Application.load_tasks
View
15 test/dummy/app/assets/javascripts/application.js
@@ -0,0 +1,15 @@
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
+// GO AFTER THE REQUIRES BELOW.
+//
+//= require jquery
+//= require jquery_ujs
+//= require_tree .
View
13 test/dummy/app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
+ *= require_self
+ *= require_tree .
+*/
View
0  app/controllers/application_controller.rb → ...app/controllers/application_controller.rb
File renamed without changes
View
0  app/helpers/application_helper.rb → test/dummy/app/helpers/application_helper.rb
File renamed without changes
View
0  test/dummy/app/mailers/.gitkeep
No changes.
View
0  test/dummy/app/models/.gitkeep
No changes.
View
14 test/dummy/app/views/layouts/application.html.erb
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Dummy</title>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+</head>
+<body>
+
+<%= yield %>
+
+</body>
+</html>
View
0  app/views/layouts/templates/default.html.erb → .../views/layouts/templates/default.html.erb
File renamed without changes
View
2  config.ru → test/dummy/config.ru
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run BcmsGoogleMiniSearch::Application
+run Dummy::Application
View
31 config/application.rb → test/dummy/config/application.rb
@@ -2,15 +2,11 @@
require 'rails/all'
-# If you have a Gemfile, require the gems listed there, including any gems
-# you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env) if defined?(Bundler)
+Bundler.require
+require "bcms_google_mini_search"
-module BcmsGoogleMiniSearch
+module Dummy
class Application < Rails::Application
-
- # BrowserCMS must serve static CMS assets (js, css, images) from the Gem
- config.serve_static_assets = true
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
@@ -33,13 +29,28 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
- # JavaScript files you want as :defaults (application.js is always included).
- # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
-
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+
+ # Use SQL instead of Active Record's schema dumper when creating the database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ config.active_record.whitelist_attributes = true
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
end
end
+
View
10 test/dummy/config/boot.rb
@@ -0,0 +1,10 @@
+require 'rubygems'
+gemfile = File.expand_path('../../../../Gemfile', __FILE__)
+
+if File.exist?(gemfile)
+ ENV['BUNDLE_GEMFILE'] = gemfile
+ require 'bundler'
+ Bundler.setup
+end
+
+$:.unshift File.expand_path('../../../../lib', __FILE__)
View
0  config/database.yml → test/dummy/config/database.yml
File renamed without changes
View
2  config/environment.rb → test/dummy/config/environment.rb
@@ -2,4 +2,4 @@
require File.expand_path('../application', __FILE__)
# Initialize the rails application
-BcmsGoogleMiniSearch::Application.initialize!
+Dummy::Application.initialize!
View
21 config/environments/development.rb → .../dummy/config/environments/development.rb
@@ -1,9 +1,9 @@
-BcmsGoogleMiniSearch::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the webserver when you make code changes.
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@
# Show full error reports and disable caching
config.consider_all_requests_local = true
- config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
@@ -22,5 +21,17 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
-end
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ # Do not compress assets
+ config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
+end
View
46 config/environments/production.rb → test/dummy/config/environments/production.rb
@@ -1,7 +1,6 @@
-BcmsGoogleMiniSearch::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
- # The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
@@ -9,31 +8,46 @@
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
- # Specifies the header that your server uses for sending files
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
+ # Disable Rails's static asset server (Apache or nginx will already do this)
+ config.serve_static_assets = false
+
+ # Compress JavaScripts and CSS
+ config.assets.compress = true
+
+ # Don't fallback to assets pipeline if a precompiled asset is missed
+ config.assets.compile = false
+
+ # Generate digests for assets URLs
+ config.assets.digest = true
+
+ # Defaults to Rails.root.join("public/assets")
+ # config.assets.manifest = YOUR_PATH
- # For nginx:
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
+ # Specifies the header that your server uses for sending files
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
- # If you have no front-end server that supports something like X-Sendfile,
- # just comment this out and Rails will serve the files
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
# See everything in the log (default is :info)
# config.log_level = :debug
+ # Prepend all log lines with the following tags
+ # config.log_tags = [ :subdomain, :uuid ]
+
# Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
# config.cache_store = :mem_cache_store
- # Disable Rails's static asset server
- # In production, Apache or nginx will already do this
- config.serve_static_assets = false
-
- # Enable serving of images, stylesheets, and javascripts from an asset server
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
+ # config.assets.precompile += %w( search.js )
+
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
@@ -46,4 +60,8 @@
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
end
View
18 config/environments/test.rb → test/dummy/config/environments/test.rb
@@ -1,13 +1,17 @@
-BcmsGoogleMiniSearch::Application.configure do
+Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
+ # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
+ # and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
- # Log error messages when you accidentally call methods on nil.
+ # Configure static asset server for tests with Cache-Control for performance
+ config.serve_static_assets = true
+ config.static_cache_control = "public, max-age=3600"
+
+ # Log error messages when you accidentally call methods on nil
config.whiny_nils = true
# Show full error reports and disable caching
@@ -25,10 +29,8 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
View
0  config/initializers/backtrace_silencers.rb → ...onfig/initializers/backtrace_silencers.rb
File renamed without changes
View
5 config/initializers/inflections.rb → .../dummy/config/initializers/inflections.rb
@@ -8,3 +8,8 @@
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
+#
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections do |inflect|
+# inflect.acronym 'RESTful'
+# end
View
0  config/initializers/mime_types.rb → test/dummy/config/initializers/mime_types.rb
File renamed without changes
View
2  config/initializers/secret_token.rb → ...dummy/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-BcmsGoogleMiniSearch::Application.config.secret_token = '329114eb84b704f84a3eabc4d95f16068341457c1bf791a9d5848ebf359066bf9846d13b0233894a28f241020c146f169aadc946d01726f33ed147ecf234c282'
+Dummy::Application.config.secret_token = '6c7972ec86d23c2b7197c62f10e75ce5b4958d30172cdfc5d6e7dab43b0cb3dbc1992dd9bbcb01a9f234e44d701e6ddc6b95c72bf5ecc7219301c5434607b34e'
View
4 config/initializers/session_store.rb → ...ummy/config/initializers/session_store.rb
@@ -1,8 +1,8 @@
# Be sure to restart your server when you modify this file.
-BcmsGoogleMiniSearch::Application.config.session_store :cookie_store, :key => '_bcms_google_mini_search_session'
+Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
-# BcmsGoogleMiniSearch::Application.config.session_store :active_record_store
+# Dummy::Application.config.session_store :active_record_store
View
14 test/dummy/config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json]
+end
+
+# Disable root element in JSON by default.
+ActiveSupport.on_load(:active_record) do
+ self.include_root_in_json = false
+end
View
2  config/locales/en.yml → test/dummy/config/locales/en.yml
@@ -1,5 +1,5 @@
# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
View
5 test/dummy/config/routes.rb
@@ -0,0 +1,5 @@
+Rails.application.routes.draw do
+
+ mount BcmsGoogleMiniSearch::Engine => "/bcms_google_mini_search"
+ mount_browsercms
+end
View
33 db/seeds.rb → test/dummy/db/browsercms.seeds.rb
@@ -4,13 +4,18 @@
if %w[development test dev local].include?(Rails.env)
pwd = "cmsadmin"
else
- pwd = (0..8).inject(""){|s,i| s << (('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a).rand}
+ pwd = (0..8).inject("") { |s, i| s << (('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a).rand }
end
-User.current = create_user(:cmsadmin, :login => "cmsadmin", :first_name => "CMS", :last_name => "Administrator", :email => "cmsadmin@example.com", :password => pwd, :password_confirmation => pwd)
+Cms::User.current = create_user(:cmsadmin, :login => "cmsadmin", :first_name => "CMS", :last_name => "Administrator", :email => "cmsadmin@example.com", :password => pwd, :password_confirmation => pwd)
-create_permission(:administrate, :name => "administrate", :full_name => "Administer CMS" , :description => "Allows users to administer the CMS, including adding users and groups.")
-create_permission(:edit_content, :name => "edit_content", :full_name => "Edit Content" , :description => "Allows users to Add, Edit and Delete both Pages and Blocks. Can Save (but not Publish) and Assign them as well.")
-create_permission(:publish_content, :name => "publish_content", :full_name => "Publish Content" , :description => "Allows users to Save and Publish, Hide and Archive both Pages and Blocks.")
+[["Cms::CategoryType", "Categorization"], ["Cms::Category","Categorization"], ["Cms::Tag", "Categorization"],
+ ["Cms::HtmlBlock", "Core"], ["Cms::Portlet", "Core"], ["Cms::FileBlock", "Core"], ["Cms::ImageBlock", "Core"]
+].each do |type|
+ create_content_type(type[0].to_sym, :name=>type[0], :group_name=>type[1])
+end
+create_permission(:administrate, :name => "administrate", :full_name => "Administer CMS", :description => "Allows users to administer the CMS, including adding users and groups.")
+create_permission(:edit_content, :name => "edit_content", :full_name => "Edit Content", :description => "Allows users to Add, Edit and Delete both Pages and Blocks. Can Save (but not Publish) and Assign them as well.")
+create_permission(:publish_content, :name => "publish_content", :full_name => "Publish Content", :description => "Allows users to Save and Publish, Hide and Archive both Pages and Blocks.")
create_group_type(:guest_group_type, :name => "Guest", :guest => true)
create_group_type(:registered_public_user, :name => "Registered Public User")
@@ -26,13 +31,13 @@
groups(:content_admin).permissions<<permissions(:administrate)
groups(:content_editor).permissions<<permissions(:edit_content)
-groups(:content_editor).permissions<<permissions(:publish_content)
+groups(:content_editor).permissions<<permissions(:publish_content)
create_site(:default, :name => "Default", :domain => "example.com")
create_section(:root, :name => "My Site", :path => "/", :root => true)
create_section(:system, :name => "system", :parent => sections(:root), :path => "/system", :hidden => true)
-
-Group.all.each{|g| g.sections = Section.all }
+
+Cms::Group.all.each { |g| g.sections = Cms::Section.all }
create_page(:home, :name => "Home", :path => "/", :section => sections(:root), :template_file_name => "default.html.erb", :cacheable => true)
create_page(:not_found, :name => "Page Not Found", :path => "/system/not_found", :section => sections(:system), :template_file_name => "default.html.erb", :publish_on_save => true, :hidden => true, :cacheable => true)
@@ -50,8 +55,10 @@
create_html_block(:server_error, :name => "Server Error", :content => "<p>The server encountered an unexpected condition that prevented it from fulfilling the request.</p>", :publish_on_save => true)
pages(:server_error).create_connector(html_blocks(:server_error), "main")
pages(:server_error).publish!
-pages(:home).publish!
-
-puts "*************************************************"
-puts "* YOUR CMS username/password is: cmsadmin/#{pwd}"
-puts "*************************************************"
+pages(:home).publish!
+
+unless Cms::DataLoader.silent_mode
+ puts "*************************************************"
+ puts "* YOUR CMS username/password is: cmsadmin/#{pwd}"
+ puts "*************************************************"
+end
View
145 ...igrate/20080815014337_browsercms_3_0_0.rb → ...grate/20120522154056_browsercms300.cms.rb
@@ -1,21 +1,22 @@
+# This migration comes from cms (originally 20080815014337)
class Browsercms300 < ActiveRecord::Migration
def self.up
- create_table "users", :force => true do |t|
- t.column :login, :string, :limit => 40
- t.column :first_name, :string, :limit => 40
- t.column :last_name, :string, :limit => 40
- t.column :email, :string, :limit => 40
- t.column :crypted_password, :string, :limit => 40
- t.column :salt, :string, :limit => 40
- t.column :created_at, :datetime
- t.column :updated_at, :datetime
- t.column :expires_at, :datetime
- t.column :remember_token, :string, :limit => 40
+ create_table prefix(:users), :force => true do |t|
+ t.column :login, :string, :limit => 40
+ t.column :first_name, :string, :limit => 40
+ t.column :last_name, :string, :limit => 40
+ t.column :email, :string, :limit => 40
+ t.column :crypted_password, :string, :limit => 40
+ t.column :salt, :string, :limit => 40
+ t.column :created_at, :datetime
+ t.column :updated_at, :datetime
+ t.column :expires_at, :datetime
+ t.column :remember_token, :string, :limit => 40
t.column :remember_token_expires_at, :datetime
end
- add_index :users, :login, :unique => true
+ add_index prefix(:users), :login, :unique => true
- create_versioned_table :dynamic_views do |t|
+ create_content_table :dynamic_views do |t|
t.string :type
t.string :name
t.string :format
@@ -24,7 +25,7 @@ def self.up
t.timestamps
end
- create_versioned_table :pages do |t|
+ create_content_table :pages do |t|
t.string :name
t.string :title
t.string :path
@@ -36,34 +37,31 @@ def self.up
t.boolean :hidden, :default => false
end
- create_table :content_type_groups do |t|
+ create_table prefix(:content_type_groups) do |t|
t.string :name
t.timestamps
end
- ContentTypeGroup.create!(:name => "Core")
- create_table :content_types do |t|
+ create_table prefix(:content_types) do |t|
t.string :name
t.belongs_to :content_type_group
t.integer :priority, :default => 2
t.timestamps
end
- create_table :category_types do |t|
+ create_table prefix(:category_types) do |t|
t.string :name
t.timestamps
end
- ContentType.create!(:name => "CategoryType", :group_name => "Categorization")
- create_table :categories do |t|
+ create_table prefix(:categories) do |t|
t.belongs_to :category_type
t.belongs_to :parent
t.string :name
t.timestamps
end
- ContentType.create!(:name => "Category", :group_name => "Categorization")
- create_table :connectors do |t|
+ create_table prefix(:connectors) do |t|
t.integer :page_id
t.integer :page_version
t.integer :connectable_id
@@ -78,9 +76,8 @@ def self.up
t.string :name
t.string :content, :limit => 64.kilobytes + 1
end
- ContentType.create!(:name => "HtmlBlock", :group_name => "Core", :priority => 1)
- create_table :sections do |t|
+ create_table prefix(:sections) do |t|
t.string :name
t.string :path
t.boolean :root, :default => false
@@ -88,7 +85,7 @@ def self.up
t.timestamps
end
- create_table :portlets do |t|
+ create_table prefix(:portlets) do |t|
t.string :type
t.string :name
t.boolean :archived, :default => false
@@ -96,20 +93,19 @@ def self.up
t.integer :created_by_id, :updated_by_id
t.timestamps
end
- create_table :portlet_attributes do |t|
+ create_table prefix(:portlet_attributes) do |t|
t.integer :portlet_id
t.string :name
t.text :value
end
- ContentType.create!(:name => "Portlet", :group_name => "Core", :priority => 1)
- create_table :redirects do |t|
+ create_table prefix(:redirects) do |t|
t.string :from_path
t.string :to_path
t.timestamps
end
- create_versioned_table :attachments do |t|
+ create_content_table :attachments do |t|
t.string :file_path
t.string :file_location
t.string :file_extension
@@ -118,60 +114,58 @@ def self.up
t.timestamps
end
- create_versioned_table :file_blocks do |t|
+ create_content_table :file_blocks do |t|
t.string :type
t.string :name
t.integer :attachment_id
t.integer :attachment_version
end
- ContentType.create!(:name => "FileBlock", :group_name => "Core")
- ContentType.create!(:name => "ImageBlock", :group_name => "Core")
- create_table :group_types do |t|
+ create_table prefix(:group_types) do |t|
t.string :name
t.boolean :guest, :default => false
t.boolean :cms_access, :default => false
t.timestamps
end
- create_table :groups do |t|
+ create_table prefix(:groups) do |t|
t.string :name
t.string :code
t.integer :group_type_id
t.timestamps
end
- create_table :user_group_memberships do |t|
+ create_table prefix(:user_group_memberships) do |t|
t.integer :user_id
t.integer :group_id
end
- create_table :permissions do |t|
+ create_table prefix(:permissions) do |t|
t.string :name
t.string :full_name
t.string :description
t.string :for_module
t.timestamps
end
- create_table :group_permissions do |t|
+ create_table prefix(:group_permissions) do |t|
t.integer :group_id
t.integer :permission_id
end
- create_table :group_type_permissions do |t|
+ create_table prefix(:group_type_permissions) do |t|
t.integer :group_type_id
t.integer :permission_id
end
- create_table :group_sections do |t|
+ create_table prefix(:group_sections) do |t|
t.integer :group_id
t.integer :section_id
end
- create_table :sites do |t|
+ create_table prefix(:sites) do |t|
t.string :name
t.string :domain
t.boolean :the_default
t.timestamps
end
- create_table :section_nodes do |t|
+ create_table prefix(:section_nodes) do |t|
t.integer :section_id
t.string :node_type
t.integer :node_id
@@ -179,20 +173,19 @@ def self.up
t.timestamps
end
- create_versioned_table :links do |t|
+ create_content_table :links do |t|
t.string :name
t.string :url
t.boolean :new_window, :default => false
t.timestamps
end
- create_table :tags do |t|
+ create_table prefix(:tags) do |t|
t.string :name
t.timestamps
end
- ContentType.create!(:name => "Tag", :group_name => "Categorization")
- create_table :taggings do |t|
+ create_table prefix(:taggings) do |t|
t.integer :tag_id
t.integer :taggable_id
t.string :taggable_type
@@ -200,7 +193,7 @@ def self.up
t.timestamps
end
- create_table :email_messages do |t|
+ create_table prefix(:email_messages) do |t|
t.string :sender
t.text :recipients
t.text :subject
@@ -212,7 +205,7 @@ def self.up
t.timestamps
end
- create_table :tasks do |t|
+ create_table prefix(:tasks) do |t|
t.integer :assigned_by_id
t.integer :assigned_to_id
t.integer :page_id
@@ -222,14 +215,14 @@ def self.up
t.timestamps
end
- create_table :page_routes do |t|
+ create_table prefix(:page_routes) do |t|
t.string :name
t.string :pattern
t.belongs_to :page
t.text :code
t.timestamps
- end
- create_table :page_route_options do |t|
+ end
+ create_table prefix(:page_route_options) do |t|
t.belongs_to :page_route
t.string :type
t.string :name
@@ -239,36 +232,36 @@ def self.up
end
def self.down
- drop_table :page_route_options
- drop_table :page_routes
- drop_table :tasks
- drop_table :email_messages
- drop_table :taggings
- drop_table :tags
+ drop_table prefix(:page_route_options)
+ drop_table prefix(:page_routes)
+ drop_table prefix(:tasks)
+ drop_table prefix(:email_messages)
+ drop_table prefix(:taggings)
+ drop_table prefix(:tags)
drop_versioned_table :links
- drop_table :section_nodes
- drop_table :sites
- drop_table :group_sections
- drop_table :group_type_permissions
- drop_table :group_permissions
- drop_table :permissions
- drop_table :user_group_memberships
- drop_table :groups
- drop_table :group_types
+ drop_table prefix(:section_nodes)
+ drop_table prefix(:sites)
+ drop_table prefix(:group_sections)
+ drop_table prefix(:group_type_permissions)
+ drop_table prefix(:group_permissions)
+ drop_table prefix(:permissions)
+ drop_table prefix(:user_group_memberships)
+ drop_table prefix(:groups)
+ drop_table prefix(:group_types)
drop_versioned_table :file_blocks
- drop_table :attachments
- drop_table :redirects
- drop_table :portlet_attributes
- drop_table :portlets
- drop_table :sections
+ drop_versioned_table :attachments
+ drop_table prefix(:redirects)
+ drop_table prefix(:portlet_attributes)
+ drop_table prefix(:portlets)
+ drop_table prefix(:sections)
drop_versioned_table :html_blocks
- drop_table :connectors
- drop_table :categories
- drop_table :category_types
- drop_table :content_types
- drop_table :content_type_groups
+ drop_table prefix(:connectors)
+ drop_table prefix(:categories)
+ drop_table prefix(:category_types)
+ drop_table prefix(:content_types)
+ drop_table prefix(:content_type_groups)
drop_versioned_table :pages
drop_versioned_table :dynamic_views
- drop_table "users"
+ drop_table prefix(:users)
end
end
View
10 test/dummy/db/migrate/20120522154057_browsercms305.cms.rb
@@ -0,0 +1,10 @@
+# This migration comes from cms (originally 20091109175123)
+class Browsercms305 < ActiveRecord::Migration
+ def self.up
+ add_column prefix(:users), :reset_token, :string
+ end
+
+ def self.down
+ remove_column prefix(:users), :reset_token
+ end
+end
View
44 db/migrate/20100117144039_browsercms315.rb → ...grate/20120522154058_browsercms315.cms.rb
@@ -1,10 +1,12 @@
+# 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|
- add_index *index
+ table, column = *index
+ add_index prefix(table), column
end
end
@@ -17,7 +19,7 @@ def self.down
[:pages, :deleted],
[:pages, :path],
[:pages, :version],
- [:page_versions, :page_id],
+ [:page_versions, :original_record_id],
[:groups, :code],
[:groups, :group_type_id],
[:group_types, :cms_access],
@@ -34,7 +36,7 @@ def self.down
[:connectors, :page_id],
[:connectors, :page_version],
[:html_blocks, :deleted],
- [:html_block_versions, :html_block_id],
+ [:html_block_versions, :original_record_id],
[:html_block_versions, :version],
[:portlet_attributes, :portlet_id],
[:portlets, :name],
@@ -44,11 +46,11 @@ def self.down
[:connectors, :connectable_type],
[:content_types, :content_type_group_id],
[:content_types, :name],
- [:file_block_versions, :file_block_id],
+ [:file_block_versions, :original_record_id],
[:file_block_versions, :version],
[:file_blocks, :deleted],
[:file_blocks, :type],
- [:attachment_versions, :attachment_id],
+ [:attachment_versions, :original_record_id],
[:tasks, :page_id],
[:tasks, :completed_at],
[:tasks, :assigned_to_id],
@@ -59,35 +61,35 @@ def self.down
# 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 :section_nodes, :ancestry, :string
- add_column :section_nodes, :temp_parent_id, :integer
+ add_column prefix(:section_nodes), :ancestry, :string
+ add_column prefix(:section_nodes), :temp_parent_id, :integer
- SectionNode.reset_column_information
- root_section = Section.root.first
- SectionNode.create!(:node => root_section) if root_section
+ Cms::SectionNode.reset_column_information
+ root_section = Cms::Section.root.first
+ Cms::SectionNode.create!(:node => root_section) if root_section
- all_nodes_but_root = SectionNode.find(:all, :conditions=>["section_id IS NOT NULL"])
+ all_nodes_but_root = Cms::SectionNode.find(:all, :conditions=>["section_id IS NOT NULL"])
all_nodes_but_root.each do |sn|
- parent_node = SectionNode.find(:first, :conditions => ["node_id = ? and node_type = 'Section'", sn.section_id])
+ 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 :section_nodes, :temp_parent_id, :parent_id # Ancestry works off the 'parent_id' column.
+ rename_column prefix(:section_nodes), :temp_parent_id, :parent_id # Ancestry works off the 'parent_id' column.
- SectionNode.build_ancestry_from_parent_ids!
- remove_column :section_nodes, :section_id
- remove_column :section_nodes, :parent_id
- SectionNode.reset_column_information
+ 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 :pages, :latest_version, :integer
- add_column :links, :latest_version, :integer
- Page.all.each do |p|
+ 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
- Link.all.each do |link|
+ Cms::Link.all.each do |link|
link.update_latest_version
end
end
View
11 ...igrate/20100705083859_browsercms_3_3_0.rb → ...grate/20120522154059_browsercms330.cms.rb
@@ -1,3 +1,4 @@
+# This migration comes from cms (originally 20100705083859)
class Browsercms330 < ActiveRecord::Migration
def self.up
@@ -5,7 +6,7 @@ def self.up
cant_fix = []
to_fix = []
# find all pages whose path ends in slash and is not root
- Page.find(:all, :conditions => "path LIKE '/%/'").each do |pt_page|
+ Cms::Page.find(:all, :conditions => "path LIKE '/%/'").each do |pt_page|
# make sure no extant page has this path
if Page.count(:conditions => ["path = ?", pt_page.path.sub(/(.+)\/+$/, '\1')]) > 0
cant_fix << pt_page
@@ -16,9 +17,9 @@ def self.up
version_cant_fix = []
version_to_fix = []
# find all page versions whose path ends in slash and is not root
- Page::Version.find(:all, :conditions => "path LIKE '/%/'").each do |pt_page|
+ Cms::Page::Version.find(:all, :conditions => "path LIKE '/%/'").each do |pt_page|
# make sure no extant page has this path
- if Page.count(:conditions => ["path = ?", pt_page.path.sub(/(.+)\/+$/, '\1')]) > 0
+ if Cms::Page.count(:conditions => ["path = ?", pt_page.path.sub(/(.+)\/+$/, '\1')]) > 0
version_cant_fix << pt_page
else
version_to_fix << pt_page
@@ -34,13 +35,13 @@ def self.up
# change the path of all pages with a trailing slash to not have one
# using sql updates to prevent unwanted callbacks
new_path = fix_page.path.to_s.sub(/(.+)\/+$/, '\1')
- execute "UPDATE pages SET path = '#{new_path}' WHERE id = #{fix_page.id};"
+ execute "UPDATE #{prefix('pages')} SET path = '#{new_path}' WHERE id = #{fix_page.id};"
end
version_to_fix.each do |fix_page|
# change the path of all fixable page versions with a trailing slash to not have one
# using sql updates to prevent unwanted callbacks
new_path = fix_page.path.to_s.sub(/(.+)\/+$/, '\1')
- execute "UPDATE page_versions SET path = '#{new_path}' WHERE id = #{fix_page.id};"
+ execute "UPDATE #{prefix('page_versions')} SET path = '#{new_path}' WHERE id = #{fix_page.id};"
end
# end patch for LH345
end
View
63 test/dummy/db/migrate/20120522154060_browsercms340.cms.rb
@@ -0,0 +1,63 @@
+# This migration comes from cms (originally 20111130221145)
+# Upgrade to Browsercms v3.4.0
+require 'cms/upgrades/v3_4_0'
+class Browsercms340 < ActiveRecord::Migration
+ include Cms::Upgrades::V3_4_0::SchemaStatements
+
+ def change
+ # Namespace class_names where they are not namespaced.
+ %w[HtmlBlock Category CategoryType Portlet FileBlock ImageBlock Tag].each do |content_type|
+ update_content_types(content_type)
+ update_connectors_table(content_type)
+ end
+
+ update_sitemap
+ update_files
+ standardize_foreign_keys_from_versions_tables_to_original_table
+ end
+
+ private
+
+ def namespace_model(name)
+ "Cms::#{name}"
+ end
+
+ def update_files
+ %w[FileBlock ImageBlock].each do |content_type|
+ Cms::AbstractFileBlock.update_all("type = '#{namespace_model(content_type)}'", "type = '#{content_type}'")
+ end
+ end
+
+ def update_sitemap
+ %w[Section Page Link Attachment].each do |addressable|
+ Cms::SectionNode.where(:node_type=>addressable).each do |node|
+ node.node_type = namespace_model(addressable)
+ node.save!
+ end
+ end
+ end
+
+ def update_content_types(name)
+ found = Cms::ContentType.named(name).first
+ if found
+ found.name = namespace_model(name)
+ found.save!
+ end
+ end
+
+ def update_connectors_table(name)
+ namespaced_class = namespace_model(name)
+ puts "Update connectors for #{name} to #{namespaced_class}"
+ Cms::Connector.where(:connectable_type => name).each do |connector|
+ connector.connectable_type = namespaced_class
+ connector.save!
+ end
+ end
+
+ def standardize_foreign_keys_from_versions_tables_to_original_table
+ models = %w[attachment dynamic_view file_block html_block link page ]
+ models.each do |model|
+ standardize_version_id_column(model)
+ end
+ end
+end
View
33 test/dummy/db/migrate/20120522154061_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
503 test/dummy/db/schema.rb
@@ -0,0 +1,503 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20120522154061) do
+
+ create_table "categories", :force => true do |t|
+ t.integer "category_type_id"
+ t.integer "parent_id"
+ t.string "name"
+ 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", :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|
+ t.integer "page_id"
+ t.integer "page_version"
+ t.integer "connectable_id"
+ t.string "connectable_type"
+ t.integer "connectable_version"
+ t.string "container"
+ t.integer "position"
+ 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", :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", :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"
+ t.string "type"
+ t.string "name"
+ t.string "format"
+ t.string "handler"
+ t.text "body"
+ 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.string "version_comment"
+ t.integer "created_by_id"
+ t.integer "updated_by_id"
+ end
+
+ create_table "dynamic_views", :force => true do |t|
+ t.integer "version"
+ t.integer "lock_version", :default => 0
+ t.string "type"
+ t.string "name"
+ t.string "format"
+ t.string "handler"
+ t.text "body"
+ 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"
+ end
+
+ create_table "email_messages", :force => true do |t|
+ t.string "sender"
+ t.text "recipients"
+ t.text "subject"
+ t.text "cc"
+ t.text "bcc"
+ t.text "body"
+ t.string "content_type"
+ t.datetime "delivered_at"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "file_block_versions", :force => true do |t|
+ t.integer "original_record_id"
+ t.integer "version"
+ t.string "type"
+ t.string "name"
+ t.integer "attachment_id"
+ t.integer "attachment_version"
+ 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.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
+ t.string "type"
+ t.string "name"
+ t.integer "attachment_id"
+ t.integer "attachment_version"
+ 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.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"
+ end
+
+ create_table "group_types", :force => true do |t|
+ t.string "name"
+ t.boolean "guest", :default => false
+ t.boolean "cms_access", :default => false
+ 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", :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"
+ t.string "name"
+ t.text "content", :limit => 16777215
+ 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.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
+ t.string "name"
+ t.text "content", :limit => 16777215
+ 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.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", :null => false
+ t.datetime "updated_at", :null => false
+ 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 "links", :force => true do |t|
+ t.integer "version"
+ t.integer "lock_version", :default => 0
+ t.string "name"
+ t.string "url"
+ 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", :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", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "page_versions", :force => true do |t|
+ t.integer "original_record_id"
+ t.integer "version"
+ t.string "name"
+ t.string "title"
+ t.string "path"
+ t.string "template_file_name"
+ t.text "description"
+ t.text "keywords"
+ t.string "language"
+ t.boolean "cacheable", :default => false
+ t.boolean "hidden", :default => false
+ 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.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
+ t.string "name"
+ t.string "title"
+ t.string "path"
+ t.string "template_file_name"
+ t.text "description"
+ t.text "keywords"
+ t.string "language"
+ t.boolean "cacheable", :default => false
+ t.boolean "hidden", :default => 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.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", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table <