From 1f868494ff3da1f62f3844b93a2e175642e5d558 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Mon, 13 Mar 2017 21:00:44 -0400 Subject: [PATCH 01/13] stuff --- Gemfile | 10 +- Gemfile.lock | 234 +++++++++++++++++++++++++-------------------- browsercms.gemspec | 6 +- 3 files changed, 137 insertions(+), 113 deletions(-) diff --git a/Gemfile b/Gemfile index 072ca689c..eee650787 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,8 @@ gem 'bluecloth', :groups=>[:development, :test] # For YARD gem "thin" # To avoid annoying Ruby 1.9.3/Rails/Webrick warnings - See http://stackoverflow.com/questions/7082364/what-does-warn-could-not-determine-content-length-of-response-body-mean-and-h -gem 'sass-rails' - +gem 'sass-rails', '~>5.0.0' +gem 'sprockets-rails', '~>2.3.1' # Uncomment to confirm that older versions work (for compaitiblity with Spree 2.2.4/bcms_spree) # gem 'paperclip', '~> 3.4.1' @@ -30,9 +30,9 @@ group :development do #gem 'binding_of_caller' end group :test, :development do - gem 'minitest' - gem 'minitest-rails' - gem 'minitest-reporters' + gem 'minitest', '~>5.3.3' + gem 'minitest-rails', '~>2.0.0' + gem 'minitest-reporters', '~>1.0.0' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index 8d07e0f13..ca209a495 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,13 +6,13 @@ PATH ancestry (~> 2.0.0) bootstrap-sass ckeditor_rails (~> 4.3.0) - compass-rails (~> 1.1.7) + compass-rails (~> 3.0.0) devise (~> 3.0) jquery-rails (~> 3.1) jquery-ui-rails (~> 4.1) panoramic paperclip (~> 3.4) - rails (~> 4.0.0) + rails (~> 4.2.0) sass-rails simple_form (>= 3.0.0.rc, < 3.1) term-ansicolor @@ -22,46 +22,59 @@ PATH GEM remote: http://rubygems.org/ specs: - actionmailer (4.0.2) - actionpack (= 4.0.2) - mail (~> 2.5.4) - actionpack (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - erubis (~> 2.7.0) - rack (~> 1.5.2) + actionmailer (4.2.8) + actionpack (= 4.2.8) + actionview (= 4.2.8) + activejob (= 4.2.8) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (4.2.8) + actionview (= 4.2.8) + activesupport (= 4.2.8) + rack (~> 1.6) rack-test (~> 0.6.2) - actionpack-page_caching (1.0.2) - actionpack (>= 4.0.0, < 5) - activemodel (4.0.2) - activesupport (= 4.0.2) - builder (~> 3.1.0) - activerecord (4.0.2) - activemodel (= 4.0.2) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.2) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.2) - i18n (~> 0.6, >= 0.6.4) - minitest (~> 4.2) - multi_json (~> 1.3) - thread_safe (~> 0.1) - tzinfo (~> 0.3.37) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionpack-page_caching (1.1.0) + actionpack (>= 4.0.0, < 6) + actionview (4.2.8) + activesupport (= 4.2.8) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (4.2.8) + activesupport (= 4.2.8) + globalid (>= 0.3.0) + activemodel (4.2.8) + activesupport (= 4.2.8) + builder (~> 3.1) + activerecord (4.2.8) + activemodel (= 4.2.8) + activesupport (= 4.2.8) + arel (~> 6.0) + activesupport (4.2.8) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) addressable (2.3.5) ancestry (2.0.0) activerecord (>= 3.0.0) - ansi (1.4.3) - arel (4.0.2) + ansi (1.5.0) + arel (6.0.4) aruba (0.5.3) childprocess (>= 0.3.6) cucumber (>= 1.1.1) rspec-expectations (>= 2.7.0) - bcrypt (3.1.10) + autoprefixer-rails (6.7.7) + execjs + bcrypt (3.1.11) bluecloth (2.2.0) - bootstrap-sass (3.2.0.2) - sass (~> 3.2) - builder (3.1.4) + bootstrap-sass (3.3.7) + autoprefixer-rails (>= 5.2.1) + sass (>= 3.3.4) + builder (3.2.3) capybara (2.1.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -70,12 +83,11 @@ GEM xpath (~> 2.0) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) - chunky_png (1.3.4) + chunky_png (1.3.8) ckeditor_rails (4.3.4) railties (>= 3.0) - climate_control (0.0.3) - activesupport (>= 3.0) - cocaine (0.5.7) + climate_control (0.1.0) + cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) compass (1.0.3) chunky_png (~> 1.2) @@ -89,9 +101,11 @@ GEM sass (>= 3.3.0, < 3.5) compass-import-once (1.0.5) sass (>= 3.2, < 3.5) - compass-rails (1.1.7) - compass (>= 0.12.2) - sprockets (<= 2.11.0) + compass-rails (3.0.2) + compass (~> 1.0.0) + sass-rails (< 5.1) + sprockets (< 4.0) + concurrent-ruby (1.0.5) cucumber (2.4.0) builder (>= 2.1.2) cucumber-core (~> 1.5.0) @@ -111,7 +125,7 @@ GEM cucumber-wire (0.0.1) daemons (1.1.9) database_cleaner (1.2.0) - devise (3.5.1) + devise (3.5.10) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 3.2.6, < 5) @@ -132,36 +146,39 @@ GEM eventmachine (>= 0.12.0) ffi (1.9.0) gherkin (4.0.0) - hashie (2.0.5) - hike (1.2.3) + globalid (0.3.7) + activesupport (>= 4.1.0) http_parser.rb (0.5.3) - i18n (0.6.11) - jquery-rails (3.1.3) + i18n (0.8.1) + jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) jquery-ui-rails (4.2.1) railties (>= 3.2.16) launchy (2.3.0) addressable (~> 2.3) + loofah (2.0.3) + nokogiri (>= 1.5.9) m (1.3.2) method_source (>= 0.6.7) rake (>= 0.9.2.2) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) + mail (2.6.4) + mime-types (>= 1.16, < 4) metaclass (0.0.1) method_source (0.8.2) - mime-types (1.25.1) + mime-types (3.1) + mime-types-data (~> 3.2015) + mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - minitest (4.7.5) - minitest-rails (0.9.2) - minitest (~> 4.7) - rails (>= 3.0) - minitest-reporters (0.14.20) + minitest (5.3.5) + minitest-rails (2.0.3) + minitest (>= 5.3.3, < 6.0) + railties (~> 4.1) + minitest-reporters (1.0.20) ansi builder - minitest (>= 2.12, < 5.0) - powerbar + minitest (>= 5.0) + ruby-progressbar mocha (0.14.0) metaclass (~> 0.0.1) multi_json (1.12.1) @@ -170,7 +187,7 @@ GEM nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) orm_adapter (0.5.0) - panoramic (0.0.4) + panoramic (0.0.6) rails (>= 3.0.7) paperclip (3.5.4) activemodel (>= 3.0.0) @@ -181,80 +198,86 @@ GEM capybara (~> 2.1.0) faye-websocket (>= 0.4.4, < 0.5.0) http_parser.rb (~> 0.5.3) - polyglot (0.3.3) - powerbar (1.0.11) - ansi (~> 1.4.0) - hashie (>= 1.1.0) quiet_assets (1.0.2) railties (>= 3.1, < 5.0) - rack (1.5.5) + rack (1.6.5) rack-test (0.6.3) rack (>= 1.0) - rails (4.0.2) - actionmailer (= 4.0.2) - actionpack (= 4.0.2) - activerecord (= 4.0.2) - activesupport (= 4.0.2) + rails (4.2.8) + actionmailer (= 4.2.8) + actionpack (= 4.2.8) + actionview (= 4.2.8) + activejob (= 4.2.8) + activemodel (= 4.2.8) + activerecord (= 4.2.8) + activesupport (= 4.2.8) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.2) - sprockets-rails (~> 2.0.0) - railties (4.0.2) - actionpack (= 4.0.2) - activesupport (= 4.0.2) + railties (= 4.2.8) + sprockets-rails + rails-deprecated_sanitizer (1.0.3) + activesupport (>= 4.2.0.alpha) + rails-dom-testing (1.0.8) + activesupport (>= 4.2.0.beta, < 5.0) + nokogiri (~> 1.6) + rails-deprecated_sanitizer (>= 1.0.1) + rails-html-sanitizer (1.0.3) + loofah (~> 2.0) + railties (4.2.8) + actionpack (= 4.2.8) + activesupport (= 4.2.8) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.1.1) - rb-fsevent (0.9.5) - rb-inotify (0.9.5) + rake (12.0.0) + rb-fsevent (0.9.8) + rb-inotify (0.9.8) ffi (>= 0.5.0) - responders (1.1.2) - railties (>= 3.2, < 4.2) + responders (2.3.0) + railties (>= 4.2.0, < 5.1) rspec-expectations (2.14.1) diff-lcs (>= 1.1.3, < 2.0) ruby-prof (0.13.0) - sass (3.4.16) - sass-rails (4.0.1) - railties (>= 4.0.0, < 5.0) - sass (>= 3.1.10) - sprockets-rails (~> 2.0.0) + ruby-progressbar (1.8.1) + sass (3.4.23) + sass-rails (5.0.6) + railties (>= 4.0.0, < 6) + sass (~> 3.1) + sprockets (>= 2.8, < 4.0) + sprockets-rails (>= 2.0, < 4.0) + tilt (>= 1.1, < 3) simple_form (3.1.0.rc2) actionpack (~> 4.0) activemodel (~> 4.0) single_test (0.6.0) rake - sprockets (2.10.1) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + sprockets (3.7.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) - sprockets (~> 2.8) + sprockets (>= 2.8, < 4.0) sqlite3 (1.3.7) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) - term-ansicolor (1.3.0) + term-ansicolor (1.4.0) tins (~> 1.0) thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - thor (0.18.1) - thread_safe (0.3.4) - tilt (1.4.1) - tins (1.3.3) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.41) + thor (0.19.4) + thread_safe (0.3.6) + tilt (2.0.6) + tins (1.13.2) + tzinfo (1.2.2) + thread_safe (~> 0.1) uglifier (2.1.2) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - underscore-rails (1.7.0) - warden (1.2.3) + underscore-rails (1.8.3) + warden (1.2.7) rack (>= 1.0) - will_paginate (3.0.7) + will_paginate (3.0.12) xpath (2.0.0) nokogiri (~> 1.3) yard (0.8.7) @@ -273,17 +296,18 @@ DEPENDENCIES factory_girl_rails (= 3.3.0) launchy m (~> 1.2) - minitest - minitest-rails - minitest-reporters + minitest (~> 5.3.3) + minitest-rails (~> 2.0.0) + minitest-reporters (~> 1.0.0) mocha mysql2 poltergeist quiet_assets rake ruby-prof - sass-rails + sass-rails (~> 5.0.0) single_test + sprockets-rails (~> 2.3.1) sqlite3-ruby thin uglifier diff --git a/browsercms.gemspec b/browsercms.gemspec index b572174e2..72b6ccdfd 100644 --- a/browsercms.gemspec +++ b/browsercms.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |s| GPL.txt README.markdown } - s.required_ruby_version = '>= 1.9.2' + s.required_ruby_version = '>= 2.0.0' s.files = Dir["{app,bin,db,doc,lib,vendor}/**/*"] s.files += Dir[".yardopts"] @@ -30,11 +30,11 @@ Gem::Specification.new do |s| s.executables = ["bcms", "browsercms"] - s.add_dependency("rails", "~> 4.0.0") + s.add_dependency("rails", "~> 4.2.0") s.add_dependency("devise", "~> 3.0") s.add_dependency("sass-rails") s.add_dependency("bootstrap-sass") - s.add_dependency("compass-rails", "~> 1.1.7") + s.add_dependency("compass-rails", "~> 3.0.0") s.add_dependency("ancestry", "~> 2.0.0") s.add_dependency("ckeditor_rails", "~> 4.3.0") s.add_dependency("underscore-rails", "~> 1.4") From 6c6fa0772cc794e87dd312582ed471fb964eab8f Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Mon, 13 Mar 2017 21:49:26 -0400 Subject: [PATCH 02/13] Fixes validation errors for 4.2 upgrade --- lib/cms/behaviors/attaching.rb | 6 +- test/dummy/db/schema.rb | 810 ++++++++++++++++----------------- 2 files changed, 408 insertions(+), 408 deletions(-) diff --git a/lib/cms/behaviors/attaching.rb b/lib/cms/behaviors/attaching.rb index 1bd632aa5..54397efa0 100644 --- a/lib/cms/behaviors/attaching.rb +++ b/lib/cms/behaviors/attaching.rb @@ -76,7 +76,7 @@ def validates_attachment_size(name, options = {}) #options[:unless] = Proc.new {|r| r.a.asset_name != name.to_s} - validate(options) do |record| + validate do |record| record.attachments.each do |attachment| next unless attachment.attachment_name == name.to_s record.errors.add_to_base(message) unless range.include?(attachment.data_file_size) @@ -86,7 +86,7 @@ def validates_attachment_size(name, options = {}) def validates_attachment_presence(name, options = {}) message = options[:message] || "Must provide at least one #{name}" - validate(options) do |record| + validate do |record| return if record.deleted? unless record.attachments.any? { |a| a.attachment_name == name.to_s } record.errors.add(:attachment, message) @@ -97,7 +97,7 @@ def validates_attachment_presence(name, options = {}) def validates_attachment_content_type(name, options = {}) validation_options = options.dup allowed_types = [validation_options[:content_type]].flatten - validate(validation_options) do |record| + validate do |record| attachments.each do |a| if !allowed_types.any? { |t| t === a.data_content_type } && !(a.data_content_type.nil? || a.data_content_type.blank?) record.add_to_base(options[:message] || "is not one of #{allowed_types.join(', ')}") diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 0b4a81fe1..7b37aaa99 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -13,104 +13,104 @@ ActiveRecord::Schema.define(version: 20130924162315) do - create_table "catalog_versions", force: true do |t| - t.string "name" + create_table "catalog_versions", force: :cascade do |t| + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.integer "original_record_id" - t.integer "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" - end - - create_table "catalogs", force: true do |t| - t.string "name" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "version" - t.integer "lock_version", default: 0 - 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 "cms_attachment_versions", force: true do |t| - t.string "data_file_name" - t.string "data_file_path" - t.string "file_location" - t.string "data_content_type" - t.integer "data_file_size" - t.string "data_fingerprint" - t.string "attachable_type" - t.string "attachment_name" - t.integer "attachable_id" - t.integer "attachable_version" - t.string "cardinality" - t.integer "original_record_id" - t.integer "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.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + end + + create_table "catalogs", force: :cascade do |t| + t.string "name", limit: 255 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + end + + create_table "cms_attachment_versions", force: :cascade do |t| + t.string "data_file_name", limit: 255 + t.string "data_file_path", limit: 255 + t.string "file_location", limit: 255 + t.string "data_content_type", limit: 255 + t.integer "data_file_size", limit: 4 + t.string "data_fingerprint", limit: 255 + t.string "attachable_type", limit: 255 + t.string "attachment_name", limit: 255 + t.integer "attachable_id", limit: 4 + t.integer "attachable_version", limit: 4 + t.string "cardinality", limit: 255 + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_attachment_versions", ["original_record_id"], name: "index_cms_attachment_versions_on_original_record_id", using: :btree - create_table "cms_attachments", force: true do |t| - t.string "data_file_name" - t.string "data_file_path" - t.string "file_location" - t.string "data_content_type" - t.integer "data_file_size" - t.string "data_fingerprint" - t.string "attachable_type" - t.string "attachment_name" - t.integer "attachable_id" - t.integer "attachable_version" - t.string "cardinality" - t.integer "version" - t.integer "lock_version", default: 0 - 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" + create_table "cms_attachments", force: :cascade do |t| + t.string "data_file_name", limit: 255 + t.string "data_file_path", limit: 255 + t.string "file_location", limit: 255 + t.string "data_content_type", limit: 255 + t.integer "data_file_size", limit: 4 + t.string "data_fingerprint", limit: 255 + t.string "attachable_type", limit: 255 + t.string "attachment_name", limit: 255 + t.integer "attachable_id", limit: 4 + t.integer "attachable_version", limit: 4 + t.string "cardinality", limit: 255 + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_categories", force: true do |t| - t.integer "category_type_id" - t.integer "parent_id" - t.string "name" + create_table "cms_categories", force: :cascade do |t| + t.integer "category_type_id", limit: 4 + t.integer "parent_id", limit: 4 + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_category_types", force: true do |t| - t.string "name" + create_table "cms_category_types", force: :cascade do |t| + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_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" + create_table "cms_connectors", force: :cascade do |t| + t.integer "page_id", limit: 4 + t.integer "page_version", limit: 4 + t.integer "connectable_id", limit: 4 + t.string "connectable_type", limit: 255 + t.integer "connectable_version", limit: 4 + t.string "container", limit: 255 + t.integer "position", limit: 4 t.datetime "created_at" t.datetime "updated_at" end @@ -120,73 +120,73 @@ add_index "cms_connectors", ["page_id"], name: "index_cms_connectors_on_page_id", using: :btree add_index "cms_connectors", ["page_version"], name: "index_cms_connectors_on_page_version", using: :btree - create_table "cms_dynamic_view_versions", force: true do |t| - t.string "type" - t.string "name" - t.string "format" - t.string "handler" - t.text "body" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "original_record_id" - t.integer "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.string "path" - t.string "locale", default: "en" - t.boolean "partial", default: false - end - - create_table "cms_dynamic_views", force: true do |t| - t.string "type" - t.string "name" - t.string "format" - t.string "handler" - t.text "body" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "version" - t.integer "lock_version", default: 0 - 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 "path" - t.string "locale", default: "en" - t.boolean "partial", default: false - end - - create_table "cms_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" + create_table "cms_dynamic_view_versions", force: :cascade do |t| + t.string "type", limit: 255 + t.string "name", limit: 255 + t.string "format", limit: 255 + t.string "handler", limit: 255 + t.text "body", limit: 65535 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + t.string "path", limit: 255 + t.string "locale", limit: 255, default: "en" + t.boolean "partial", default: false + end + + create_table "cms_dynamic_views", force: :cascade do |t| + t.string "type", limit: 255 + t.string "name", limit: 255 + t.string "format", limit: 255 + t.string "handler", limit: 255 + t.text "body", limit: 65535 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + t.string "path", limit: 255 + t.string "locale", limit: 255, default: "en" + t.boolean "partial", default: false + end + + create_table "cms_email_messages", force: :cascade do |t| + t.string "sender", limit: 255 + t.text "recipients", limit: 65535 + t.text "subject", limit: 65535 + t.text "cc", limit: 65535 + t.text "bcc", limit: 65535 + t.text "body", limit: 65535 + t.string "content_type", limit: 255 t.datetime "delivered_at" t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_file_block_versions", force: true do |t| - t.string "type" - t.string "name" - t.integer "attachment_id" - t.integer "attachment_version" - t.integer "original_record_id" - t.integer "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" + create_table "cms_file_block_versions", force: :cascade do |t| + t.string "type", limit: 255 + t.string "name", limit: 255 + t.integer "attachment_id", limit: 4 + t.integer "attachment_version", limit: 4 + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end @@ -194,18 +194,18 @@ add_index "cms_file_block_versions", ["original_record_id"], name: "index_cms_file_block_versions_on_original_record_id", using: :btree add_index "cms_file_block_versions", ["version"], name: "index_cms_file_block_versions_on_version", using: :btree - create_table "cms_file_blocks", force: true do |t| - t.string "type" - t.string "name" - t.integer "attachment_id" - t.integer "attachment_version" - t.integer "version" - t.integer "lock_version", default: 0 - 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" + create_table "cms_file_blocks", force: :cascade do |t| + t.string "type", limit: 255 + t.string "name", limit: 255 + t.integer "attachment_id", limit: 4 + t.integer "attachment_version", limit: 4 + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end @@ -213,102 +213,102 @@ add_index "cms_file_blocks", ["deleted"], name: "index_cms_file_blocks_on_deleted", using: :btree add_index "cms_file_blocks", ["type"], name: "index_cms_file_blocks_on_type", using: :btree - create_table "cms_form_entries", force: true do |t| - t.text "data_columns" - t.integer "form_id" + create_table "cms_form_entries", force: :cascade do |t| + t.text "data_columns", limit: 65535 + t.integer "form_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_form_fields", force: true do |t| - t.integer "form_id" - t.string "label" - t.string "name" - t.string "field_type" + create_table "cms_form_fields", force: :cascade do |t| + t.integer "form_id", limit: 4 + t.string "label", limit: 255 + t.string "name", limit: 255 + t.string "field_type", limit: 255 t.boolean "required" - t.integer "position" - t.text "instructions" - t.text "default_value" - t.text "choices" + t.integer "position", limit: 4 + t.text "instructions", limit: 65535 + t.text "default_value", limit: 65535 + t.text "choices", limit: 65535 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_form_fields", ["form_id", "name"], name: "index_cms_form_fields_on_form_id_and_name", unique: true, using: :btree - create_table "cms_form_versions", force: true do |t| - t.string "name" - t.text "description" - t.string "confirmation_behavior" - t.text "confirmation_text" - t.string "confirmation_redirect" - t.string "notification_email" - t.integer "original_record_id" - t.integer "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" + create_table "cms_form_versions", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.string "confirmation_behavior", limit: 255 + t.text "confirmation_text", limit: 65535 + t.string "confirmation_redirect", limit: 255 + t.string "notification_email", limit: 255 + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_forms", force: true do |t| - t.string "name" - t.text "description" - t.string "confirmation_behavior" - t.text "confirmation_text" - t.string "confirmation_redirect" - t.string "notification_email" - t.integer "version" - t.integer "lock_version", default: 0 - 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" + create_table "cms_forms", force: :cascade do |t| + t.string "name", limit: 255 + t.text "description", limit: 65535 + t.string "confirmation_behavior", limit: 255 + t.text "confirmation_text", limit: 65535 + t.string "confirmation_redirect", limit: 255 + t.string "notification_email", limit: 255 + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_group_permissions", force: true do |t| - t.integer "group_id" - t.integer "permission_id" + create_table "cms_group_permissions", force: :cascade do |t| + t.integer "group_id", limit: 4 + t.integer "permission_id", limit: 4 end add_index "cms_group_permissions", ["group_id", "permission_id"], name: "index_cms_group_permissions_on_group_id_and_permission_id", using: :btree add_index "cms_group_permissions", ["group_id"], name: "index_cms_group_permissions_on_group_id", using: :btree add_index "cms_group_permissions", ["permission_id"], name: "index_cms_group_permissions_on_permission_id", using: :btree - create_table "cms_group_sections", force: true do |t| - t.integer "group_id" - t.integer "section_id" + create_table "cms_group_sections", force: :cascade do |t| + t.integer "group_id", limit: 4 + t.integer "section_id", limit: 4 end add_index "cms_group_sections", ["group_id"], name: "index_cms_group_sections_on_group_id", using: :btree add_index "cms_group_sections", ["section_id"], name: "index_cms_group_sections_on_section_id", using: :btree - create_table "cms_group_type_permissions", force: true do |t| - t.integer "group_type_id" - t.integer "permission_id" + create_table "cms_group_type_permissions", force: :cascade do |t| + t.integer "group_type_id", limit: 4 + t.integer "permission_id", limit: 4 end - create_table "cms_group_types", force: true do |t| - t.string "name" - t.boolean "guest", default: false - t.boolean "cms_access", default: false + create_table "cms_group_types", force: :cascade do |t| + t.string "name", limit: 255 + t.boolean "guest", default: false + t.boolean "cms_access", default: false t.datetime "created_at" t.datetime "updated_at" end add_index "cms_group_types", ["cms_access"], name: "index_cms_group_types_on_cms_access", using: :btree - create_table "cms_groups", force: true do |t| - t.string "name" - t.string "code" - t.integer "group_type_id" + create_table "cms_groups", force: :cascade do |t| + t.string "name", limit: 255 + t.string "code", limit: 255 + t.integer "group_type_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end @@ -316,17 +316,17 @@ add_index "cms_groups", ["code"], name: "index_cms_groups_on_code", using: :btree add_index "cms_groups", ["group_type_id"], name: "index_cms_groups_on_group_type_id", using: :btree - create_table "cms_html_block_versions", force: true do |t| + create_table "cms_html_block_versions", force: :cascade do |t| t.text "content", limit: 16777215 - t.integer "original_record_id" - t.integer "version" - t.string "name" + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.string "name", limit: 255 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 "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end @@ -334,213 +334,213 @@ add_index "cms_html_block_versions", ["original_record_id"], name: "index_cms_html_block_versions_on_original_record_id", using: :btree add_index "cms_html_block_versions", ["version"], name: "index_cms_html_block_versions_on_version", using: :btree - create_table "cms_html_blocks", force: true do |t| + create_table "cms_html_blocks", force: :cascade do |t| t.text "content", limit: 16777215 - t.integer "version" - t.integer "lock_version", default: 0 - t.string "name" + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.string "name", limit: 255 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 "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_html_blocks", ["deleted"], name: "index_cms_html_blocks_on_deleted", using: :btree - create_table "cms_link_versions", force: true do |t| - t.string "name" - t.string "url" - t.boolean "new_window", default: false + create_table "cms_link_versions", force: :cascade do |t| + t.string "name", limit: 255 + t.string "url", limit: 255 + t.boolean "new_window", default: false t.datetime "created_at" t.datetime "updated_at" - t.integer "original_record_id" - t.integer "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.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 end - create_table "cms_links", force: true do |t| - t.string "name" - t.string "url" - t.boolean "new_window", default: false + create_table "cms_links", force: :cascade do |t| + t.string "name", limit: 255 + t.string "url", limit: 255 + t.boolean "new_window", default: false t.datetime "created_at" t.datetime "updated_at" - t.integer "version" - t.integer "lock_version", default: 0 - 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" + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + t.integer "latest_version", limit: 4 end - create_table "cms_page_route_options", force: true do |t| - t.integer "page_route_id" - t.string "type" - t.string "name" - t.string "value" + create_table "cms_page_route_options", force: :cascade do |t| + t.integer "page_route_id", limit: 4 + t.string "type", limit: 255 + t.string "name", limit: 255 + t.string "value", limit: 255 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_page_routes", force: true do |t| - t.string "name" - t.string "pattern" - t.integer "page_id" - t.text "code" + create_table "cms_page_routes", force: :cascade do |t| + t.string "name", limit: 255 + t.string "pattern", limit: 255 + t.integer "page_id", limit: 4 + t.text "code", limit: 65535 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_page_versions", force: true do |t| - 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.integer "original_record_id" - t.integer "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" + create_table "cms_page_versions", force: :cascade do |t| + t.string "name", limit: 255 + t.string "title", limit: 255 + t.string "path", limit: 255 + t.string "template_file_name", limit: 255 + t.text "description", limit: 65535 + t.text "keywords", limit: 65535 + t.string "language", limit: 255 + t.boolean "cacheable", default: false + t.boolean "hidden", default: false + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_page_versions", ["original_record_id"], name: "index_cms_page_versions_on_original_record_id", using: :btree - create_table "cms_pages", force: true do |t| - 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.integer "version" - t.integer "lock_version", default: 0 - 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" + create_table "cms_pages", force: :cascade do |t| + t.string "name", limit: 255 + t.string "title", limit: 255 + t.string "path", limit: 255 + t.string "template_file_name", limit: 255 + t.text "description", limit: 65535 + t.text "keywords", limit: 65535 + t.string "language", limit: 255 + t.boolean "cacheable", default: false + t.boolean "hidden", default: false + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" - t.integer "latest_version" + t.integer "latest_version", limit: 4 end add_index "cms_pages", ["deleted"], name: "index_cms_pages_on_deleted", using: :btree add_index "cms_pages", ["path"], name: "index_cms_pages_on_path", using: :btree add_index "cms_pages", ["version"], name: "index_cms_pages_on_version", using: :btree - create_table "cms_permissions", force: true do |t| - t.string "name" - t.string "full_name" - t.string "description" - t.string "for_module" + create_table "cms_permissions", force: :cascade do |t| + t.string "name", limit: 255 + t.string "full_name", limit: 255 + t.string "description", limit: 255 + t.string "for_module", limit: 255 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_portlet_attributes", force: true do |t| - t.integer "portlet_id" - t.string "name" - t.text "value" + create_table "cms_portlet_attributes", force: :cascade do |t| + t.integer "portlet_id", limit: 4 + t.string "name", limit: 255 + t.text "value", limit: 65535 end add_index "cms_portlet_attributes", ["portlet_id"], name: "index_cms_portlet_attributes_on_portlet_id", using: :btree - create_table "cms_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" + create_table "cms_portlets", force: :cascade do |t| + t.string "type", limit: 255 + t.string "name", limit: 255 + t.boolean "archived", default: false + t.boolean "deleted", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_portlets", ["name"], name: "index_cms_portlets_on_name", using: :btree - create_table "cms_redirects", force: true do |t| - t.string "from_path" - t.string "to_path" + create_table "cms_redirects", force: :cascade do |t| + t.string "from_path", limit: 255 + t.string "to_path", limit: 255 t.datetime "created_at" t.datetime "updated_at" end add_index "cms_redirects", ["from_path"], name: "index_cms_redirects_on_from_path", using: :btree - create_table "cms_section_nodes", force: true do |t| - t.string "node_type" - t.integer "node_id" - t.integer "position" - t.string "ancestry" + create_table "cms_section_nodes", force: :cascade do |t| + t.string "node_type", limit: 255 + t.integer "node_id", limit: 4 + t.integer "position", limit: 4 + t.string "ancestry", limit: 255 t.datetime "created_at" t.datetime "updated_at" - t.string "slug" + t.string "slug", limit: 255 end add_index "cms_section_nodes", ["ancestry"], name: "index_cms_section_nodes_on_ancestry", using: :btree add_index "cms_section_nodes", ["node_type"], name: "index_cms_section_nodes_on_node_type", using: :btree - create_table "cms_sections", force: true do |t| - t.string "name" - t.string "path" - t.boolean "root", default: false - t.boolean "hidden", default: false + create_table "cms_sections", force: :cascade do |t| + t.string "name", limit: 255 + t.string "path", limit: 255 + t.boolean "root", default: false + t.boolean "hidden", default: false t.datetime "created_at" t.datetime "updated_at" end add_index "cms_sections", ["path"], name: "index_cms_sections_on_path", using: :btree - create_table "cms_sites", force: true do |t| - t.string "name" - t.string "domain" + create_table "cms_sites", force: :cascade do |t| + t.string "name", limit: 255 + t.string "domain", limit: 255 t.boolean "the_default" t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_taggings", force: true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "taggable_version" + create_table "cms_taggings", force: :cascade do |t| + t.integer "tag_id", limit: 4 + t.integer "taggable_id", limit: 4 + t.string "taggable_type", limit: 255 + t.integer "taggable_version", limit: 4 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_tags", force: true do |t| - t.string "name" + create_table "cms_tags", force: :cascade do |t| + t.string "name", limit: 255 t.datetime "created_at" t.datetime "updated_at" end - create_table "cms_tasks", force: true do |t| - t.integer "assigned_by_id" - t.integer "assigned_to_id" - t.integer "page_id" - t.text "comment" + create_table "cms_tasks", force: :cascade do |t| + t.integer "assigned_by_id", limit: 4 + t.integer "assigned_to_id", limit: 4 + t.integer "page_id", limit: 4 + t.text "comment", limit: 65535 t.date "due_date" t.datetime "completed_at" t.datetime "created_at" @@ -551,15 +551,15 @@ add_index "cms_tasks", ["completed_at"], name: "index_cms_tasks_on_completed_at", using: :btree add_index "cms_tasks", ["page_id"], name: "index_cms_tasks_on_page_id", using: :btree - create_table "cms_user_group_memberships", force: true do |t| - t.integer "user_id" - t.integer "group_id" + create_table "cms_user_group_memberships", force: :cascade do |t| + t.integer "user_id", limit: 4 + t.integer "group_id", limit: 4 end add_index "cms_user_group_memberships", ["group_id"], name: "index_cms_user_group_memberships_on_group_id", using: :btree add_index "cms_user_group_memberships", ["user_id"], name: "index_cms_user_group_memberships_on_user_id", using: :btree - create_table "cms_users", force: true do |t| + create_table "cms_users", force: :cascade do |t| t.string "login", limit: 40 t.string "first_name", limit: 40 t.string "last_name", limit: 40 @@ -569,12 +569,12 @@ t.datetime "updated_at" t.datetime "expires_at" t.datetime "remember_created_at" - t.string "reset_password_token" - t.string "encrypted_password", default: "", null: false + t.string "reset_password_token", limit: 255 + t.string "encrypted_password", limit: 255, default: "", null: false t.datetime "reset_password_sent_at" - t.string "type", default: "Cms::User" - t.string "source" - t.text "external_data" + t.string "type", limit: 255, default: "Cms::User" + t.string "source", limit: 255 + t.text "external_data", limit: 65535 end add_index "cms_users", ["email"], name: "index_cms_users_on_email", unique: true, using: :btree @@ -582,72 +582,72 @@ add_index "cms_users", ["login"], name: "index_cms_users_on_login", unique: true, using: :btree add_index "cms_users", ["reset_password_token"], name: "index_cms_users_on_reset_password_token", unique: true, using: :btree - create_table "deprecated_input_versions", force: true do |t| - t.string "name" - t.text "content" - t.text "template" - t.string "template_handler" - t.integer "category_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "original_record_id" - t.integer "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" - end - - create_table "deprecated_inputs", force: true do |t| - t.string "name" - t.text "content" - t.text "template" - t.string "template_handler" - t.integer "category_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "version" - t.integer "lock_version", default: 0 - 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 "product_versions", force: true do |t| - t.string "name" - t.integer "price" - t.integer "category_id" + create_table "deprecated_input_versions", force: :cascade do |t| + t.string "name", limit: 255 + t.text "content", limit: 65535 + t.text "template", limit: 65535 + t.string "template_handler", limit: 255 + t.integer "category_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + end + + create_table "deprecated_inputs", force: :cascade do |t| + t.string "name", limit: 255 + t.text "content", limit: 65535 + t.text "template", limit: 65535 + t.string "template_handler", limit: 255 + t.integer "category_id", limit: 4 + t.datetime "created_at" + t.datetime "updated_at" + t.integer "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 + end + + create_table "product_versions", force: :cascade do |t| + t.string "name", limit: 255 + t.integer "price", limit: 4 + t.integer "category_id", limit: 4 t.boolean "on_special" t.datetime "created_at" t.datetime "updated_at" - t.integer "original_record_id" - t.integer "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.integer "original_record_id", limit: 4 + t.integer "version", limit: 4 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.string "version_comment", limit: 255 + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 end - create_table "products", force: true do |t| - t.string "name" - t.integer "price" - t.integer "category_id" + create_table "products", force: :cascade do |t| + t.string "name", limit: 255 + t.integer "price", limit: 4 + t.integer "category_id", limit: 4 t.boolean "on_special" t.datetime "created_at" t.datetime "updated_at" - t.integer "version" - t.integer "lock_version", default: 0 - 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 "version", limit: 4 + t.integer "lock_version", limit: 4, default: 0 + t.boolean "published", default: false + t.boolean "deleted", default: false + t.boolean "archived", default: false + t.integer "created_by_id", limit: 4 + t.integer "updated_by_id", limit: 4 end end From 83e8394a6f88cfbd99ca3b180541e24284a1cedf Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Mon, 13 Mar 2017 22:42:30 -0400 Subject: [PATCH 03/13] Fixes first active model dirty rails 3 issues --- app/controllers/cms/sections_controller.rb | 2 +- app/models/cms/group.rb | 2 +- lib/cms/behaviors/taggable.rb | 3 +-- lib/cms/behaviors/versioning.rb | 8 ++++++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/controllers/cms/sections_controller.rb b/app/controllers/cms/sections_controller.rb index c47d360ba..adcf8f0ae 100644 --- a/app/controllers/cms/sections_controller.rb +++ b/app/controllers/cms/sections_controller.rb @@ -89,7 +89,7 @@ def load_section end def public_groups - @public_groups ||= Cms::Group.public.order("#{Cms::Group.table_name}.name") + @public_groups ||= Cms::Group.public_groups.order("#{Cms::Group.table_name}.name") end def cms_groups diff --git a/app/models/cms/group.rb b/app/models/cms/group.rb index b0d292e5e..da2804410 100644 --- a/app/models/cms/group.rb +++ b/app/models/cms/group.rb @@ -36,7 +36,7 @@ def with_code(c) end end - scope :public, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", false]).includes(:group_type).references(:group_type) } + scope :public_groups, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", false]).includes(:group_type).references(:group_type) } scope :cms_access, -> { where(["#{Cms::GroupType.table_name}.cms_access = ?", true]).includes(:group_type).references(:group_type) } def guest? diff --git a/lib/cms/behaviors/taggable.rb b/lib/cms/behaviors/taggable.rb index e35986869..ceabbbd13 100644 --- a/lib/cms/behaviors/taggable.rb +++ b/lib/cms/behaviors/taggable.rb @@ -44,8 +44,7 @@ def tag_list end def tag_list=(tag_names) - changed_attributes["tag_list"] = tag_list unless @tag_list == tag_names - @tag_list = tag_names + @tag_list = tag_names unless @tag_list == tag_names end def save_tags diff --git a/lib/cms/behaviors/versioning.rb b/lib/cms/behaviors/versioning.rb index 63bcb8b1e..3a77b290a 100644 --- a/lib/cms/behaviors/versioning.rb +++ b/lib/cms/behaviors/versioning.rb @@ -228,7 +228,11 @@ def create_or_update self.version = 1 # This should call ActiveRecord::Callbacks#create_or_update, which will correctly trigger the :save callback_chain saved_correctly = super - changed_attributes.clear + if self.class.private_instance_methods.include? :clear_attribute_changes + clear_attribute_changes changed_attributes + else + changed_attributes.clear + end else logger.debug { "#{self.class}#update" } # Because we are 'skipping' the normal ActiveRecord update here, we must manually call the save callback chain. @@ -336,7 +340,7 @@ def version_comment def version_comment=(version_comment) @version_comment = version_comment - send(:changed_attributes)["version_comment"] = @version_comment + #send(:changed_attributes)["version_comment"] = @version_comment end def different_from_last_draft? From 7bf1256074b65498b673876ea4b8f74ebb680568 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Tue, 14 Mar 2017 00:19:51 -0400 Subject: [PATCH 04/13] Fixes active model dirty modification --- Gemfile | 4 ++-- Gemfile.lock | 10 ++++++++++ lib/cms/behaviors/versioning.rb | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index eee650787..978ccb0a5 100644 --- a/Gemfile +++ b/Gemfile @@ -26,8 +26,8 @@ group :development do gem 'rake' # gem 'debugger' gem 'quiet_assets' - #gem 'better_errors' - #gem 'binding_of_caller' + gem 'better_errors' + gem 'binding_of_caller' end group :test, :development do gem 'minitest', '~>5.3.3' diff --git a/Gemfile.lock b/Gemfile.lock index ca209a495..3109caca4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,6 +70,12 @@ GEM autoprefixer-rails (6.7.7) execjs bcrypt (3.1.11) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) bluecloth (2.2.0) bootstrap-sass (3.3.7) autoprefixer-rails (>= 5.2.1) @@ -89,6 +95,7 @@ GEM climate_control (0.1.0) cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) + coderay (1.1.0) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -125,6 +132,7 @@ GEM cucumber-wire (0.0.1) daemons (1.1.9) database_cleaner (1.2.0) + debug_inspector (0.0.2) devise (3.5.10) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -287,6 +295,8 @@ PLATFORMS DEPENDENCIES aruba + better_errors + binding_of_caller bluecloth browsercms! capybara diff --git a/lib/cms/behaviors/versioning.rb b/lib/cms/behaviors/versioning.rb index 3a77b290a..5612373fa 100644 --- a/lib/cms/behaviors/versioning.rb +++ b/lib/cms/behaviors/versioning.rb @@ -37,7 +37,11 @@ def build_object_from_version() # Last but not least, clear the changed attributes if changed_attrs = obj.send(:changed_attributes) - changed_attrs.clear + if self.class.private_instance_methods.include? :clear_attribute_changes + clear_attribute_changes changed_attrs + else + changed_attributes.clear + end end obj From 7fcd8ada9cbe320dc1c937f0c68fb89eff753cd2 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Tue, 14 Mar 2017 23:54:32 -0400 Subject: [PATCH 05/13] Updates arel call to arel 6.0.0 --- lib/cms/behaviors/publishing.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cms/behaviors/publishing.rb b/lib/cms/behaviors/publishing.rb index 17aa6922a..e4037751a 100644 --- a/lib/cms/behaviors/publishing.rb +++ b/lib/cms/behaviors/publishing.rb @@ -145,7 +145,7 @@ def publish! end # Doing the SQL ourselves to avoid callbacks - self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).arel.update(quoted_attributes) + ActiveRecord::Base.connection.execute(self.class.unscoped.where(self.class.arel_table[self.class.primary_key].eq(id)).arel.compile_update(quoted_attributes, id).to_sql) did_publish = true end else From da664f50e22e715270d45f185ba3de79fdad3e76 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Wed, 15 Mar 2017 19:30:26 -0400 Subject: [PATCH 06/13] Forward thinking for rails 5 regarding migrations --- db/migrate/20080815014337_browsercms300.rb | 42 +++---- db/migrate/20130327184912_browsercms400.rb | 4 +- .../content_blocks_for_modules.feature | 2 +- .../content_blocks_for_projects.feature | 4 +- .../step_definitions/command_line_steps.rb | 2 +- lib/browsercms.rb | 2 +- lib/cms/behaviors/attaching.rb | 2 +- spec/concerns/addressable_spec.rb | 2 +- test/dummy/config/environments/production.rb | 5 +- test/dummy/config/environments/test.rb | 4 +- .../migrate/20111228141250_create_products.rb | 2 +- .../migrate/20120419183855_create_catalogs.rb | 2 +- ...20130924162315_create_deprecated_inputs.rb | 2 +- test/dummy/db/schema.rb | 116 +++++++++--------- test/support/database_helpers.rb | 2 +- test/unit/behaviors/attaching_test.rb | 2 +- .../unit/behaviors/dynamic_attributes_test.rb | 2 +- 17 files changed, 101 insertions(+), 96 deletions(-) diff --git a/db/migrate/20080815014337_browsercms300.rb b/db/migrate/20080815014337_browsercms300.rb index f0fab8655..874374a38 100644 --- a/db/migrate/20080815014337_browsercms300.rb +++ b/db/migrate/20080815014337_browsercms300.rb @@ -22,7 +22,7 @@ def change t.string :format t.string :handler t.text :body - t.timestamps + t.timestamps null: false end create_content_table :cms_pages do |t| @@ -40,26 +40,26 @@ def change create_table :cms_content_type_groups do |t| t.string :name - t.timestamps + t.timestamps null: false end create_table :cms_content_types do |t| t.string :name t.belongs_to :content_type_group t.integer :priority, :default => 2 - t.timestamps + t.timestamps null: false end create_table :cms_category_types do |t| t.string :name - t.timestamps + t.timestamps null: false end create_table :cms_categories do |t| t.belongs_to :category_type t.belongs_to :parent t.string :name - t.timestamps + t.timestamps null: false end create_table :cms_connectors do |t| @@ -70,7 +70,7 @@ def change t.integer :connectable_version t.string :container t.integer :position - t.timestamps + t.timestamps null: false end create_content_table :cms_html_blocks do |t| @@ -82,7 +82,7 @@ def change t.string :path t.boolean :root, :default => false t.boolean :hidden, :default => false - t.timestamps + t.timestamps null: false end create_table :cms_portlets do |t| @@ -91,7 +91,7 @@ def change t.boolean :archived, :default => false t.boolean :deleted, :default => false t.integer :created_by_id, :updated_by_id - t.timestamps + t.timestamps null: false end create_table :cms_portlet_attributes do |t| t.integer :portlet_id @@ -102,7 +102,7 @@ def change create_table :cms_redirects do |t| t.string :from_path t.string :to_path - t.timestamps + t.timestamps null: false end create_content_table :cms_attachments, name: false do |t| @@ -130,13 +130,13 @@ def change t.string :name t.boolean :guest, :default => false t.boolean :cms_access, :default => false - t.timestamps + t.timestamps null: false end create_table :cms_groups do |t| t.string :name t.string :code t.integer :group_type_id - t.timestamps + t.timestamps null: false end create_table :cms_user_group_memberships do |t| t.integer :user_id @@ -148,7 +148,7 @@ def change t.string :full_name t.string :description t.string :for_module - t.timestamps + t.timestamps null: false end create_table :cms_group_permissions do |t| t.integer :group_id @@ -167,7 +167,7 @@ def change t.string :name t.string :domain t.boolean :the_default - t.timestamps + t.timestamps null: false end create_table :cms_section_nodes do |t| @@ -175,21 +175,21 @@ def change t.integer :node_id t.integer :position t.string :ancestry - t.timestamps + t.timestamps null: false end create_content_table :cms_links do |t| t.string :name t.string :url t.boolean :new_window, :default => false - t.timestamps + t.timestamps null: false end add_column :cms_links, :latest_version, :integer create_table :cms_tags do |t| t.string :name - t.timestamps + t.timestamps null: false end create_table :cms_taggings do |t| @@ -197,7 +197,7 @@ def change t.integer :taggable_id t.string :taggable_type t.integer :taggable_version - t.timestamps + t.timestamps null: false end create_table :cms_email_messages do |t| @@ -209,7 +209,7 @@ def change t.text :body t.string :content_type t.datetime :delivered_at - t.timestamps + t.timestamps null: false end create_table :cms_tasks do |t| @@ -219,7 +219,7 @@ def change t.text :comment t.date :due_date t.datetime :completed_at - t.timestamps + t.timestamps null: false end create_table :cms_page_routes do |t| @@ -227,14 +227,14 @@ def change t.string :pattern t.belongs_to :page t.text :code - t.timestamps + t.timestamps null: false end create_table :cms_page_route_options do |t| t.belongs_to :page_route t.string :type t.string :name t.string :value - t.timestamps + t.timestamps null: false end INDEXES.each do |index| diff --git a/db/migrate/20130327184912_browsercms400.rb b/db/migrate/20130327184912_browsercms400.rb index d10a7d81a..19e3f2618 100644 --- a/db/migrate/20130327184912_browsercms400.rb +++ b/db/migrate/20130327184912_browsercms400.rb @@ -43,7 +43,7 @@ def up t.text :instructions t.text :default_value t.text :choices - t.timestamps + t.timestamps null: false end # Field names should be unique per form @@ -52,7 +52,7 @@ def up create_table :cms_form_entries do |t| t.text :data_columns t.integer :form_id - t.timestamps + t.timestamps null: false end add_devise_users diff --git a/features/generators/content_blocks_for_modules.feature b/features/generators/content_blocks_for_modules.feature index 296a89d13..5a3a0e642 100644 --- a/features/generators/content_blocks_for_modules.feature +++ b/features/generators/content_blocks_for_modules.feature @@ -40,7 +40,7 @@ Feature: Generate Content Blocks t.string :name t.string :price - t.timestamps + t.timestamps null: false end end end diff --git a/features/generators/content_blocks_for_projects.feature b/features/generators/content_blocks_for_projects.feature index e24257d38..140989f57 100644 --- a/features/generators/content_blocks_for_projects.feature +++ b/features/generators/content_blocks_for_projects.feature @@ -48,7 +48,7 @@ Feature: t.string :name t.string :price - t.timestamps + t.timestamps null:false end end end @@ -135,7 +135,7 @@ Feature: def change create_content_table :dogs do |t| - t.timestamps + t.timestamps null: false end end end diff --git a/features/step_definitions/command_line_steps.rb b/features/step_definitions/command_line_steps.rb index 902df9631..d627e1ce8 100644 --- a/features/step_definitions/command_line_steps.rb +++ b/features/step_definitions/command_line_steps.rb @@ -189,7 +189,7 @@ class #{block_name.capitalize} < ActiveRecord::Base class Create#{block_name.capitalize}s < ActiveRecord::Migration def change create_content_table :#{block_name}s do |t| - t.timestamps + t.timestamps null: false end #{been_migrated_line} end diff --git a/lib/browsercms.rb b/lib/browsercms.rb index 5bd258712..c6d77829a 100644 --- a/lib/browsercms.rb +++ b/lib/browsercms.rb @@ -2,7 +2,7 @@ require 'rails' require 'cms/configuration' require 'cms/version' -require 'browsercms' +#require 'browsercms' require 'bootstrap-sass' require 'compass-rails' diff --git a/lib/cms/behaviors/attaching.rb b/lib/cms/behaviors/attaching.rb index 54397efa0..c9f10f7e7 100644 --- a/lib/cms/behaviors/attaching.rb +++ b/lib/cms/behaviors/attaching.rb @@ -198,7 +198,7 @@ module InstanceMethods # Otherwise, if the change isn't detected, this record won't save a new version (since updates are rejected if no changes were made) def check_for_updated_attachments if attachments_changed == "true" || attachments_were_updated? - changed_attributes['attachments'] = "Uploaded new files" + self.attachments = "Uploaded new files" end end diff --git a/spec/concerns/addressable_spec.rb b/spec/concerns/addressable_spec.rb index f3c3be415..cff9f3d2c 100644 --- a/spec/concerns/addressable_spec.rb +++ b/spec/concerns/addressable_spec.rb @@ -34,7 +34,7 @@ def create_testing_table(name, &block) TESTING_TABLES << name create_table(name, &block) change_table name do |t| - t.timestamps + t.timestamps null: false end end end diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb index 724b874f5..2001794d7 100644 --- a/test/dummy/config/environments/production.rb +++ b/test/dummy/config/environments/production.rb @@ -17,7 +17,7 @@ config.cms.use_single_domain = true # Disable Rails's static asset server (Apache or nginx will already do this) - config.serve_static_assets = true # We are in 'faux' production mode, so we want Rails to serve the assets. + config.serve_static_files = true # We are in 'faux' production mode, so we want Rails to serve the assets. # Compress JavaScripts and CSS config.assets.compress = true @@ -28,6 +28,9 @@ # Generate digests for assets URLs config.assets.digest = true + #Currently, Active Record suppresses errors raised within `after_rollback`/`after_commit` callbacks and only print them to the logs. In the next version, these errors will no longer be suppressed. Instead, the errors will propagate normally just like in other Active Record callbacks. + config.active_record.raise_in_transactional_callbacks = true + # Defaults to Rails.root.join("public/assets") # config.assets.manifest = YOUR_PATH diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 661e5f444..a2ac6b44b 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -8,9 +8,11 @@ config.cache_classes = true # Configure static asset server for tests with Cache-Control for performance - config.serve_static_assets = true + config.serve_static_files = true config.static_cache_control = "public, max-age=3600" + config.active_record.raise_in_transactional_callbacks = true + config.eager_load = false # Show full error reports and disable caching diff --git a/test/dummy/db/migrate/20111228141250_create_products.rb b/test/dummy/db/migrate/20111228141250_create_products.rb index f6dcec1b6..37e057ab2 100644 --- a/test/dummy/db/migrate/20111228141250_create_products.rb +++ b/test/dummy/db/migrate/20111228141250_create_products.rb @@ -5,7 +5,7 @@ def change t.integer :price t.integer :category_id t.boolean :on_special - t.timestamps + t.timestamps null: false end end end diff --git a/test/dummy/db/migrate/20120419183855_create_catalogs.rb b/test/dummy/db/migrate/20120419183855_create_catalogs.rb index 474f11515..ae0b78856 100644 --- a/test/dummy/db/migrate/20120419183855_create_catalogs.rb +++ b/test/dummy/db/migrate/20120419183855_create_catalogs.rb @@ -3,7 +3,7 @@ def change create_content_table :catalogs do |t| t.string :name - t.timestamps + t.timestamps null: false end end end diff --git a/test/dummy/db/migrate/20130924162315_create_deprecated_inputs.rb b/test/dummy/db/migrate/20130924162315_create_deprecated_inputs.rb index babeb1a02..6033c5117 100644 --- a/test/dummy/db/migrate/20130924162315_create_deprecated_inputs.rb +++ b/test/dummy/db/migrate/20130924162315_create_deprecated_inputs.rb @@ -6,7 +6,7 @@ def change t.text :template, :size => (64.kilobytes + 1) t.string :template_handler t.belongs_to :category - t.timestamps + t.timestamps null: false end end end diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 7b37aaa99..10c40766a 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -15,8 +15,8 @@ create_table "catalog_versions", force: :cascade do |t| t.string "name", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "original_record_id", limit: 4 t.integer "version", limit: 4 t.boolean "published", default: false @@ -29,8 +29,8 @@ create_table "catalogs", force: :cascade do |t| t.string "name", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "version", limit: 4 t.integer "lock_version", limit: 4, default: 0 t.boolean "published", default: false @@ -93,14 +93,14 @@ t.integer "category_type_id", limit: 4 t.integer "parent_id", limit: 4 t.string "name", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_category_types", force: :cascade do |t| t.string "name", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_connectors", force: :cascade do |t| @@ -111,8 +111,8 @@ t.integer "connectable_version", limit: 4 t.string "container", limit: 255 t.integer "position", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_connectors", ["connectable_type"], name: "index_cms_connectors_on_connectable_type", using: :btree @@ -126,8 +126,8 @@ t.string "format", limit: 255 t.string "handler", limit: 255 t.text "body", limit: 65535 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "original_record_id", limit: 4 t.integer "version", limit: 4 t.boolean "published", default: false @@ -147,8 +147,8 @@ t.string "format", limit: 255 t.string "handler", limit: 255 t.text "body", limit: 65535 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "version", limit: 4 t.integer "lock_version", limit: 4, default: 0 t.boolean "published", default: false @@ -170,8 +170,8 @@ t.text "body", limit: 65535 t.string "content_type", limit: 255 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 "cms_file_block_versions", force: :cascade do |t| @@ -216,8 +216,8 @@ create_table "cms_form_entries", force: :cascade do |t| t.text "data_columns", limit: 65535 t.integer "form_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_form_fields", force: :cascade do |t| @@ -230,8 +230,8 @@ t.text "instructions", limit: 65535 t.text "default_value", limit: 65535 t.text "choices", limit: 65535 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_form_fields", ["form_id", "name"], name: "index_cms_form_fields_on_form_id_and_name", unique: true, using: :btree @@ -299,8 +299,8 @@ t.string "name", limit: 255 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 "cms_group_types", ["cms_access"], name: "index_cms_group_types_on_cms_access", using: :btree @@ -309,8 +309,8 @@ t.string "name", limit: 255 t.string "code", limit: 255 t.integer "group_type_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_groups", ["code"], name: "index_cms_groups_on_code", using: :btree @@ -354,8 +354,8 @@ t.string "name", limit: 255 t.string "url", limit: 255 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.integer "original_record_id", limit: 4 t.integer "version", limit: 4 t.boolean "published", default: false @@ -370,8 +370,8 @@ t.string "name", limit: 255 t.string "url", limit: 255 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.integer "version", limit: 4 t.integer "lock_version", limit: 4, default: 0 t.boolean "published", default: false @@ -387,8 +387,8 @@ t.string "type", limit: 255 t.string "name", limit: 255 t.string "value", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_page_routes", force: :cascade do |t| @@ -396,8 +396,8 @@ t.string "pattern", limit: 255 t.integer "page_id", limit: 4 t.text "code", limit: 65535 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_page_versions", force: :cascade do |t| @@ -455,8 +455,8 @@ t.string "full_name", limit: 255 t.string "description", limit: 255 t.string "for_module", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_portlet_attributes", force: :cascade do |t| @@ -474,8 +474,8 @@ t.boolean "deleted", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_portlets", ["name"], name: "index_cms_portlets_on_name", using: :btree @@ -483,8 +483,8 @@ create_table "cms_redirects", force: :cascade do |t| t.string "from_path", limit: 255 t.string "to_path", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_redirects", ["from_path"], name: "index_cms_redirects_on_from_path", using: :btree @@ -494,8 +494,8 @@ t.integer "node_id", limit: 4 t.integer "position", limit: 4 t.string "ancestry", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "slug", limit: 255 end @@ -507,8 +507,8 @@ t.string "path", limit: 255 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 "cms_sections", ["path"], name: "index_cms_sections_on_path", using: :btree @@ -517,8 +517,8 @@ t.string "name", limit: 255 t.string "domain", limit: 255 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 "cms_taggings", force: :cascade do |t| @@ -526,14 +526,14 @@ t.integer "taggable_id", limit: 4 t.string "taggable_type", limit: 255 t.integer "taggable_version", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_tags", force: :cascade do |t| t.string "name", limit: 255 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_tasks", force: :cascade do |t| @@ -543,8 +543,8 @@ t.text "comment", limit: 65535 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 "cms_tasks", ["assigned_to_id"], name: "index_cms_tasks_on_assigned_to_id", using: :btree @@ -588,8 +588,8 @@ t.text "template", limit: 65535 t.string "template_handler", limit: 255 t.integer "category_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "original_record_id", limit: 4 t.integer "version", limit: 4 t.boolean "published", default: false @@ -606,8 +606,8 @@ t.text "template", limit: 65535 t.string "template_handler", limit: 255 t.integer "category_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "version", limit: 4 t.integer "lock_version", limit: 4, default: 0 t.boolean "published", default: false @@ -622,8 +622,8 @@ t.integer "price", limit: 4 t.integer "category_id", limit: 4 t.boolean "on_special" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "original_record_id", limit: 4 t.integer "version", limit: 4 t.boolean "published", default: false @@ -639,8 +639,8 @@ t.integer "price", limit: 4 t.integer "category_id", limit: 4 t.boolean "on_special" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "version", limit: 4 t.integer "lock_version", limit: 4, default: 0 t.boolean "published", default: false diff --git a/test/support/database_helpers.rb b/test/support/database_helpers.rb index f80e74035..9b3e6cd5b 100644 --- a/test/support/database_helpers.rb +++ b/test/support/database_helpers.rb @@ -8,7 +8,7 @@ def self.ensure_content_table_exists(name) drop_table("#{name.to_s.singularize}_versions".to_sym) rescue nil create_content_table(name) do |t| t.string :name - t.timestamps + t.timestamps null: false end end end diff --git a/test/unit/behaviors/attaching_test.rb b/test/unit/behaviors/attaching_test.rb index 890ff008c..e86ba9369 100644 --- a/test/unit/behaviors/attaching_test.rb +++ b/test/unit/behaviors/attaching_test.rb @@ -243,7 +243,7 @@ class SendFileStrategyTest < ActiveSupport::TestCase private def given_an_attachment_with_file_path(expected_path, options={}) @attachment = stub(:file_name => "NAME", :file_type => "TYPE") - expect = @attachment.expects(:path).with(options[:style]).returns(expected_path) + @attachment.expects(:path).with(options[:style]).returns(expected_path) File.expects(:exists?).with(expected_path).returns(true) end diff --git a/test/unit/behaviors/dynamic_attributes_test.rb b/test/unit/behaviors/dynamic_attributes_test.rb index d622e168a..988a4f386 100644 --- a/test/unit/behaviors/dynamic_attributes_test.rb +++ b/test/unit/behaviors/dynamic_attributes_test.rb @@ -5,7 +5,7 @@ drop_table(:thing_attributes) if table_exists?(:thing_attributes) create_table(:things) do |t| t.string :name - t.timestamps + t.timestamps null: false end create_table(:thing_attributes) do |t| t.integer :thing_id From f76384a388e6867c05dc7699430021b86db65bd2 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Wed, 15 Mar 2017 20:09:11 -0400 Subject: [PATCH 07/13] prep for rails 5 test order --- test/dummy/config/environments/test.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index a2ac6b44b..f9059cc89 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -32,4 +32,7 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + + config.active_support.test_order = :sorted + end From 0639393b24b21fa2b54cd452ee5ea44fb3fbca2b Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Thu, 16 Mar 2017 00:11:22 -0400 Subject: [PATCH 08/13] Fixes attachment versioning and email tests --- app/models/cms/email_message.rb | 6 +-- features/step_definitions/.gitkeep | 0 lib/cms/behaviors/attaching.rb | 3 +- lib/tasks/cucumberrake.txt | 65 ++++++++++++++++++++++++++++++ test/minitest_helper.rb | 3 +- test/unit/models/user_test.rb | 2 +- 6 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 features/step_definitions/.gitkeep create mode 100644 lib/tasks/cucumberrake.txt diff --git a/app/models/cms/email_message.rb b/app/models/cms/email_message.rb index 5b909af7b..f57ac4a1b 100644 --- a/app/models/cms/email_message.rb +++ b/app/models/cms/email_message.rb @@ -6,7 +6,7 @@ class EmailMessage < ActiveRecord::Base scope :undelivered, -> { where("delivered_at is null") } validates_presence_of :recipients - after_create :deliver_now + after_create :deliver_mail_now def delivered? !!delivered_at @@ -48,14 +48,14 @@ def self.mailbot_address end #TODO: Take this out when we have an email queue processor - def deliver_now + def deliver_mail_now deliver! end def deliver! return false if delivered? self.sender = self.class.mailbot_address if self.sender.blank? - Cms::EmailMessageMailer.email_message(self).deliver + Cms::EmailMessageMailer.email_message(self).deliver_now update_attributes(:delivered_at => Time.now) end diff --git a/features/step_definitions/.gitkeep b/features/step_definitions/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/lib/cms/behaviors/attaching.rb b/lib/cms/behaviors/attaching.rb index c9f10f7e7..46812c637 100644 --- a/lib/cms/behaviors/attaching.rb +++ b/lib/cms/behaviors/attaching.rb @@ -198,7 +198,8 @@ module InstanceMethods # Otherwise, if the change isn't detected, this record won't save a new version (since updates are rejected if no changes were made) def check_for_updated_attachments if attachments_changed == "true" || attachments_were_updated? - self.attachments = "Uploaded new files" + attr_name = self.attributes.keys.last + self.send("#{attr_name}_will_change!") end end diff --git a/lib/tasks/cucumberrake.txt b/lib/tasks/cucumberrake.txt new file mode 100644 index 000000000..83f79471e --- /dev/null +++ b/lib/tasks/cucumberrake.txt @@ -0,0 +1,65 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks + +vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? + +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| + t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. + t.fork = true # You may get faster startup if you set this to false + t.profile = 'default' + end + + Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'wip' + end + + Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'rerun' + end + + desc 'Run all features' + task :all => [:ok, :wip] + + task :statsetup do + require 'rails/code_statistics' + ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features') + ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features') + end + end + desc 'Alias for cucumber:ok' + task :cucumber => 'cucumber:ok' + + task :default => :cucumber + + task :features => :cucumber do + STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" + end + + # In case we don't have ActiveRecord, append a no-op task that we can depend upon. + task 'db:test:prepare' do + end + + task :stats => 'cucumber:statsetup' +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + end +end + +end diff --git a/test/minitest_helper.rb b/test/minitest_helper.rb index a7bde94ee..3c20a36e0 100644 --- a/test/minitest_helper.rb +++ b/test/minitest_helper.rb @@ -2,8 +2,9 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__) require "rails/test_help" require "minitest/spec" -#require "minitest/autorun" +require "minitest/autorun" require "minitest/unit" +require "mocha/setup" #ENV["RAILS_ENV"] = "test" #require File.expand_path("../dummy/config/environment.rb", __FILE__) diff --git a/test/unit/models/user_test.rb b/test/unit/models/user_test.rb index 26b36cc58..146e856cb 100644 --- a/test/unit/models/user_test.rb +++ b/test/unit/models/user_test.rb @@ -67,7 +67,7 @@ def test_disable_enable test "email validation" do assert @user.valid? - valid_emails = ['t@test.com', 'T@test.com', 'test@somewhere.mobi', 'test@somewhere.tv', 'joe_blow@somewhere.co.nz', 'joe_blow@somewhere.com.au', 't@t-t.co', 'test@somewhere.x', 'test@somewhere..'] + valid_emails = ['t@test.com', 'T@test.com', 'test@somewhere.mobi', 'test@somewhere.tv', 'joe_blow@somewhere.co.nz', 'joe_blow@somewhere.com.au', 't@t-t.co', 'test@somewhere.x'] valid_emails.each do |email| @user.email = email assert @user.valid? From df2f88d6f846199151f191f30efc1e63ed7c2616 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Thu, 16 Mar 2017 22:35:21 -0400 Subject: [PATCH 09/13] begins fixing unit tests --- app/models/cms/category.rb | 2 +- test/unit/models/attachment_test.rb | 2 +- test/unit/models/connector_test.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/cms/category.rb b/app/models/cms/category.rb index 929a6ecea..7258a4ac7 100644 --- a/app/models/cms/category.rb +++ b/app/models/cms/category.rb @@ -30,7 +30,7 @@ def of_type(type_name) def ancestors fn = lambda do |cat, parents| if cat.parent_id - p = self.class.find(cat.parent) + p = self.class.find(cat.parent.id) fn.call(p, (parents << p)) else parents.reverse diff --git a/test/unit/models/attachment_test.rb b/test/unit/models/attachment_test.rb index 27e5611f7..d8c528ed5 100644 --- a/test/unit/models/attachment_test.rb +++ b/test/unit/models/attachment_test.rb @@ -5,7 +5,7 @@ class AttachmentTest < ActiveSupport::TestCase test "#attachable_class sets #attachable_type attribute" do a = Cms::Attachment.new a.attachable_class = Cms::FileBlock - assert_equal Cms::FileBlock, a.attachable_type + assert_equal Cms::FileBlock.to_s, a.attachable_type end test "Attachments are configured" do diff --git a/test/unit/models/connector_test.rb b/test/unit/models/connector_test.rb index abac4555c..139d926a5 100644 --- a/test/unit/models/connector_test.rb +++ b/test/unit/models/connector_test.rb @@ -80,9 +80,9 @@ def test_connectable_with_deleted log_table_without_stamps Cms::Connector - assert_nil @page.connectors.for_page_version(2).first.connectable + assert_nil @page.connectors.for_page_version(2).first.try(:connectable) - c = @page.connectors.for_page_version(2).first.connectable_with_deleted + c = @page.connectors.for_page_version(2).first.try(:connectable_with_deleted) assert !c.nil? assert_equal @block.id, c.id assert_equal @block.name, c.name From 7d03cfd3250c5564998913e19b769a1b850c3953 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Fri, 17 Mar 2017 00:51:27 -0400 Subject: [PATCH 10/13] More test fixes --- app/models/cms/abstract_file_block.rb | 2 +- lib/cms/behaviors/attaching.rb | 7 ++++--- lib/cms/behaviors/versioning.rb | 3 +++ spec/cms/email_message_spec.rb | 2 +- test/unit/helpers/application_helper_test.rb | 2 +- test/unit/models/file_block_test.rb | 2 +- test/unit/models/html_block_test.rb | 6 ++++++ test/unit/portlets/list_portlet_test.rb | 2 +- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/models/cms/abstract_file_block.rb b/app/models/cms/abstract_file_block.rb index 8efae4a17..2335ac053 100644 --- a/app/models/cms/abstract_file_block.rb +++ b/app/models/cms/abstract_file_block.rb @@ -4,7 +4,7 @@ class AbstractFileBlock < ActiveRecord::Base def self.with_parent_id(parent_id) if parent_id == 'all' - where(true) # Empty scope for chaining + self.all # Empty scope for chaining else self.includes({:attachments => :section_node}) .references(:section_node) diff --git a/lib/cms/behaviors/attaching.rb b/lib/cms/behaviors/attaching.rb index 46812c637..05ca63db8 100644 --- a/lib/cms/behaviors/attaching.rb +++ b/lib/cms/behaviors/attaching.rb @@ -87,9 +87,10 @@ def validates_attachment_size(name, options = {}) def validates_attachment_presence(name, options = {}) message = options[:message] || "Must provide at least one #{name}" validate do |record| - return if record.deleted? - unless record.attachments.any? { |a| a.attachment_name == name.to_s } - record.errors.add(:attachment, message) + if !record.deleted? + unless record.attachments.any? { |a| a.attachment_name == name.to_s } + record.errors.add(:attachment, message) + end end end end diff --git a/lib/cms/behaviors/versioning.rb b/lib/cms/behaviors/versioning.rb index 5612373fa..e2025e4c9 100644 --- a/lib/cms/behaviors/versioning.rb +++ b/lib/cms/behaviors/versioning.rb @@ -345,6 +345,9 @@ def version_comment def version_comment=(version_comment) @version_comment = version_comment #send(:changed_attributes)["version_comment"] = @version_comment + #attr_name = "version_comment" + #self.send("#{attr_name}_will_change!") + #self.version_comment = @version_comment end def different_from_last_draft? diff --git a/spec/cms/email_message_spec.rb b/spec/cms/email_message_spec.rb index 1fb77f2c4..a50fb53c2 100644 --- a/spec/cms/email_message_spec.rb +++ b/spec/cms/email_message_spec.rb @@ -11,7 +11,7 @@ describe "#absolute_cms_url" do it "should return a url which points to the cms admin version of a page" do - Rails.configuration.cms.expects(:site_domain).returns('www.example.com') + Rails.configuration.cms.expects(:site_domain).retu rns('www.example.com') url = Cms::EmailMessage.absolute_cms_url("/some-path") url.must_equal "http://cms.example.com/some-path" end diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 4f1e66062..b2a6404c9 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -46,7 +46,7 @@ class Cms::ApplicationHelper::EditButtonTest < ActionView::TestCase # Scenario: Edit Buttons should: test "generate a button without an explicit title by default" do - expected_html = ' Edit ' + expected_html = ' Edit ' assert_equal expected_html, edit_button end diff --git a/test/unit/models/file_block_test.rb b/test/unit/models/file_block_test.rb index 828fb5481..a9a60c3ec 100644 --- a/test/unit/models/file_block_test.rb +++ b/test/unit/models/file_block_test.rb @@ -66,7 +66,7 @@ def test_table_name @file_block.save! assert_not_nil @file_block.file - found = Cms::FileBlock.find(@file_block) + found = Cms::FileBlock.find(@file_block.id) assert_not_nil found.file end diff --git a/test/unit/models/html_block_test.rb b/test/unit/models/html_block_test.rb index 6a8174394..fab5847c8 100644 --- a/test/unit/models/html_block_test.rb +++ b/test/unit/models/html_block_test.rb @@ -10,6 +10,12 @@ class HtmlBlockTest < ActiveSupport::TestCase blue = create(:html_block, name: 'blue') results = Cms::HtmlBlock.paginate(page: 1, per_page: 1) + + puts "this is red" + puts red + puts "this is results" + puts results.first + puts "" assert_equal 1, results.size assert_equal red, results.first end diff --git a/test/unit/portlets/list_portlet_test.rb b/test/unit/portlets/list_portlet_test.rb index b483daff8..0466cb2c0 100644 --- a/test/unit/portlets/list_portlet_test.rb +++ b/test/unit/portlets/list_portlet_test.rb @@ -1,4 +1,4 @@ -require File.join(File.dirname(__FILE__), '/../../test_helper') +require 'test_helper' class ListTest < ActiveSupport::TestCase From 1a17d485d172c9bea1060d4e088435abe5cf78bb Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Sun, 19 Mar 2017 10:02:11 -0400 Subject: [PATCH 11/13] more test fixes --- Rakefile | 1 + app/helpers/cms/section_nodes_helper.rb | 2 +- app/models/cms/form.rb | 1 + lib/cms/behaviors/attaching.rb | 2 +- lib/cms/behaviors/dynamic_attributes.rb | 2 +- .../abstract/schema_statements.rb | 4 +- lib/command_line.rb | 2 +- spec/cms/email_message_spec.rb | 2 +- spec/cms/form_fields_spec.rb | 8 ++-- spec/cms/form_spec.rb | 2 +- spec/concerns/addressable_spec.rb | 15 ++++--- spec/minitest_helper.rb | 1 + test/dummy/db/schema.rb | 40 +++++++++---------- .../cms/sections_controller_test.rb | 4 +- test/minitest_helper.rb | 4 +- test/support/factory_helpers.rb | 2 +- test/test_helper.rb | 5 ++- 17 files changed, 53 insertions(+), 44 deletions(-) diff --git a/Rakefile b/Rakefile index 1d0892159..ec13f40c5 100644 --- a/Rakefile +++ b/Rakefile @@ -91,6 +91,7 @@ def run_tests(tests_to_run) Rake::Task[task].invoke nil rescue => e + puts e {:task => task, :exception => e} end end.compact diff --git a/app/helpers/cms/section_nodes_helper.rb b/app/helpers/cms/section_nodes_helper.rb index 3b05dea42..4d9e81950 100644 --- a/app/helpers/cms/section_nodes_helper.rb +++ b/app/helpers/cms/section_nodes_helper.rb @@ -21,7 +21,7 @@ def add_link_path_data(section_node, parent_section_node) def add_section_path_data(section_node, parent_section_node) section = figure_out_target_section(parent_section_node, section_node) - new_section_path(section_id: section) + new_section_path(section_id: section.id) end # When sitemap initially renders, we only want to show first level. diff --git a/app/models/cms/form.rb b/app/models/cms/form.rb index e9f1dee1c..10b84dfd4 100644 --- a/app/models/cms/form.rb +++ b/app/models/cms/form.rb @@ -26,6 +26,7 @@ def field(name) end def required?(name) + name = name.to_s if name.class==Symbol field = field(name) field ? field.required? : false end diff --git a/lib/cms/behaviors/attaching.rb b/lib/cms/behaviors/attaching.rb index 05ca63db8..634e32ffe 100644 --- a/lib/cms/behaviors/attaching.rb +++ b/lib/cms/behaviors/attaching.rb @@ -219,7 +219,7 @@ def attachment_names end def after_publish - attachments.each &:publish + attachments.each(&:publish) end # Locates the attachment with a given name diff --git a/lib/cms/behaviors/dynamic_attributes.rb b/lib/cms/behaviors/dynamic_attributes.rb index c73195d44..bf13c2bb7 100644 --- a/lib/cms/behaviors/dynamic_attributes.rb +++ b/lib/cms/behaviors/dynamic_attributes.rb @@ -233,7 +233,7 @@ def assign_attributes(new_attributes, options = {}) return unless new_attributes attributes = new_attributes.stringify_keys - role = options[:as] || :default + options[:as] || :default multi_parameter_attributes = [] diff --git a/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb b/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb index f209e476c..8c5ade664 100644 --- a/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +++ b/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb @@ -38,7 +38,7 @@ def create_content_table(table_name, options={}, &block) td.boolean :archived, :default => false td.integer :created_by_id td.integer :updated_by_id - td.timestamps unless column_exists?(table_name.to_sym, :created_at) + td.timestamps null: false unless column_exists?(table_name.to_sym, :created_at) end if versioned @@ -54,7 +54,7 @@ def create_content_table(table_name, options={}, &block) vt.string :version_comment vt.integer :created_by_id vt.integer :updated_by_id - vt.timestamps unless column_exists?(table_name_versioned, :created_at) + vt.timestamps null: false unless column_exists?(table_name_versioned, :created_at) end end diff --git a/lib/command_line.rb b/lib/command_line.rb index f54fd4dbf..32c442140 100644 --- a/lib/command_line.rb +++ b/lib/command_line.rb @@ -29,7 +29,7 @@ def self.set_template(args) def self.template_dir current_file = File.expand_path(File.dirname(__FILE__)) gem_dir = File.join(current_file, "..") - template_dir = File.join(gem_dir, "templates") + File.join(gem_dir, "templates") end # Return the file for the given template. diff --git a/spec/cms/email_message_spec.rb b/spec/cms/email_message_spec.rb index a50fb53c2..1fb77f2c4 100644 --- a/spec/cms/email_message_spec.rb +++ b/spec/cms/email_message_spec.rb @@ -11,7 +11,7 @@ describe "#absolute_cms_url" do it "should return a url which points to the cms admin version of a page" do - Rails.configuration.cms.expects(:site_domain).retu rns('www.example.com') + Rails.configuration.cms.expects(:site_domain).returns('www.example.com') url = Cms::EmailMessage.absolute_cms_url("/some-path") url.must_equal "http://cms.example.com/some-path" end diff --git a/spec/cms/form_fields_spec.rb b/spec/cms/form_fields_spec.rb index dd504b59b..fbfcd9b95 100644 --- a/spec/cms/form_fields_spec.rb +++ b/spec/cms/form_fields_spec.rb @@ -1,5 +1,5 @@ require "minitest_helper" - +require 'mocha' describe Cms::FormField do describe '.permitted_params' do @@ -34,18 +34,18 @@ describe '#name' do it "should return a symbol that can be used as the name for inputs" do field = Cms::FormField.create!(label: 'Name') - field.name.must_equal :name + field.name.must_equal "name" end it "should underscore names" do field = Cms::FormField.create!(label: 'Full Name') - field.name.must_equal :full_name + field.name.must_equal "full_name" end it "should not change after being saved even when the label is changed" do field = Cms::FormField.create!(label: 'Name') field.update(label: 'Full Name') - field.name.must_equal :name + field.name.must_equal "name" end diff --git a/spec/cms/form_spec.rb b/spec/cms/form_spec.rb index 96dc92cae..1f896c00d 100644 --- a/spec/cms/form_spec.rb +++ b/spec/cms/form_spec.rb @@ -106,7 +106,7 @@ def form_with_fields(field_labels=[]) form.fields << Cms::FormField.new(label: 'Name') form.fields << Cms::FormField.new(label: 'Email') form.save! - form.field_names.must_equal [:name, :email] + form.field_names.must_equal ["name", "email"] end end diff --git a/spec/concerns/addressable_spec.rb b/spec/concerns/addressable_spec.rb index cff9f3d2c..838142b2f 100644 --- a/spec/concerns/addressable_spec.rb +++ b/spec/concerns/addressable_spec.rb @@ -71,6 +71,9 @@ def create_testing_table(name, &block) WannabeAddressable.expects(:has_one) WannabeAddressable.expects(:after_save) WannabeAddressable.expects(:after_validation) + puts "heres info" + puts WannabeAddressable.class + puts WannabeAddressable.to_yaml WannabeAddressable.is_addressable WannabeAddressable.new.must_respond_to :parent end @@ -132,7 +135,7 @@ class Dummy::OverrideSpecifiedTemplate < ActiveRecord::Base describe ".destroy" do it "should also delete the section node" do - add = IsAddressable.create(slug: "coke", parent_id: root_section) + add = IsAddressable.create(slug: "coke", parent_id: root_section.id) before = Cms::SectionNode.count add.destroy (Cms::SectionNode.count - before).must_equal -1 @@ -157,8 +160,8 @@ class Dummy::OverrideSpecifiedTemplate < ActiveRecord::Base end it "should be unique for each class" do - first = IsAddressable.create(slug: "first", parent_id: root_section) - duplicate = IsAddressable.create(slug: "first", parent_id: root_section) + first = IsAddressable.create(slug: "first", parent_id: root_section.id) + duplicate = IsAddressable.create(slug: "first", parent_id: root_section.id) duplicate.wont_be :valid? duplicate.section_node.errors[:slug].must_equal ["has already been taken"] @@ -188,7 +191,7 @@ class Dummy::OverrideSpecifiedTemplate < ActiveRecord::Base end it "should find content" do - content = IsAddressable.create(slug: "coke", parent_id: root_section) + content = IsAddressable.create(slug: "coke", parent_id: root_section.id) found = IsAddressable.with_slug("coke") found.wont_be_nil @@ -196,8 +199,8 @@ class Dummy::OverrideSpecifiedTemplate < ActiveRecord::Base end it "should find correct type" do - AnotherAddressable.create!(slug: "coke", parent_id: root_section) - content = IsAddressable.create(slug: "coke", parent_id: root_section) + AnotherAddressable.create!(slug: "coke", parent_id: root_section.id) + content = IsAddressable.create(slug: "coke", parent_id: root_section.id) found = IsAddressable.with_slug("coke") found.must_equal content diff --git a/spec/minitest_helper.rb b/spec/minitest_helper.rb index 01eca4e0c..47090f61c 100644 --- a/spec/minitest_helper.rb +++ b/spec/minitest_helper.rb @@ -4,6 +4,7 @@ require "minitest/spec" require "minitest/unit" + Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } require File.expand_path("../../test/factories/factories", __FILE__) require File.expand_path("../../test/factories/attachable_factories", __FILE__) diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 10c40766a..625ed5c07 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -60,8 +60,8 @@ t.string "version_comment", limit: 255 t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_attachment_versions", ["original_record_id"], name: "index_cms_attachment_versions_on_original_record_id", using: :btree @@ -85,8 +85,8 @@ t.boolean "archived", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_categories", force: :cascade do |t| @@ -187,8 +187,8 @@ t.string "version_comment", limit: 255 t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_file_block_versions", ["original_record_id"], name: "index_cms_file_block_versions_on_original_record_id", using: :btree @@ -206,8 +206,8 @@ t.boolean "archived", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_file_blocks", ["deleted"], name: "index_cms_file_blocks_on_deleted", using: :btree @@ -251,8 +251,8 @@ t.string "version_comment", limit: 255 t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_forms", force: :cascade do |t| @@ -269,8 +269,8 @@ t.boolean "archived", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end create_table "cms_group_permissions", force: :cascade do |t| @@ -327,8 +327,8 @@ t.string "version_comment", limit: 255 t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_html_block_versions", ["original_record_id"], name: "index_cms_html_block_versions_on_original_record_id", using: :btree @@ -344,8 +344,8 @@ t.boolean "archived", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_html_blocks", ["deleted"], name: "index_cms_html_blocks_on_deleted", using: :btree @@ -418,8 +418,8 @@ t.string "version_comment", limit: 255 t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end add_index "cms_page_versions", ["original_record_id"], name: "index_cms_page_versions_on_original_record_id", using: :btree @@ -441,8 +441,8 @@ t.boolean "archived", default: false t.integer "created_by_id", limit: 4 t.integer "updated_by_id", limit: 4 - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "latest_version", limit: 4 end diff --git a/test/functional/cms/sections_controller_test.rb b/test/functional/cms/sections_controller_test.rb index 242e12b98..4e44d4508 100644 --- a/test/functional/cms/sections_controller_test.rb +++ b/test/functional/cms/sections_controller_test.rb @@ -89,10 +89,10 @@ def test_new_permissions def test_create_permissions login_as(@user) - post :create, :section_id => @editable_section, section: {:name => "Another editable subsection"} + post :create, :section_id => @editable_section.id, section: {:name => "Another editable subsection"} assert_response :success - post :create, :section_id => @noneditable_section, section: {:name => "Another non-editable subsection"} + post :create, :section_id => @noneditable_section.id, section: {:name => "Another non-editable subsection"} assert_response 403 assert_template "cms/shared/access_denied" end diff --git a/test/minitest_helper.rb b/test/minitest_helper.rb index 3c20a36e0..59c54ad24 100644 --- a/test/minitest_helper.rb +++ b/test/minitest_helper.rb @@ -15,7 +15,6 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } require 'factories/factories' require 'factories/attachable_factories' - require 'minitest/reporters' MiniTest::Reporters.use! @@ -36,6 +35,9 @@ class Minitest::Spec include FactoryHelpers end +require 'mocha' + + #class MiniTest::Rails::ActiveSupport::TestCase # # # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. diff --git a/test/support/factory_helpers.rb b/test/support/factory_helpers.rb index 838c72ac3..f616c95f8 100644 --- a/test/support/factory_helpers.rb +++ b/test/support/factory_helpers.rb @@ -3,7 +3,7 @@ module FactoryHelpers def new_attachment(name="spreadsheet", path=nil) {"0" => { :data => mock_file, - :section_id => root_section, + :section_id => root_section.id, :data_file_path => path, :attachment_name => name}} end diff --git a/test/test_helper.rb b/test/test_helper.rb index e0c75cd93..ccf02ddd0 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -8,7 +8,6 @@ require 'minitest/unit' # Load support files Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } - require 'mocha/setup' require 'action_view/test_case' @@ -25,10 +24,12 @@ require 'factories/attachable_factories' # Silence warnings (hopefully) primarily from HTML parsing in functional tests. -$VERBOSE = nil +#$VERBOSE = nil require 'support/engine_controller_hacks' + + class ActiveSupport::TestCase include FactoryGirl::Syntax::Methods From afc0cca1a5cfd7f66124512ceb73957c812f758c Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Sun, 19 Mar 2017 22:51:16 -0400 Subject: [PATCH 12/13] Continues fixing tests. --- Gemfile | 2 ++ Gemfile.lock | 14 ++++++++++++-- Rakefile | 1 - app/models/cms/page.rb | 4 ++-- browsercms.gemspec | 2 +- features/commands/generate_module.feature | 2 +- features/support/env.rb | 4 ++++ features/support/minitest.rb | 2 ++ lib/cms/behaviors/publishing.rb | 3 +-- lib/cms/behaviors/soft_deleting.rb | 2 +- lib/cms/behaviors/taggable.rb | 2 ++ lib/cms/behaviors/versioning.rb | 11 +++++++---- spec/cms/form_fields_spec.rb | 2 +- spec/concerns/addressable_spec.rb | 3 --- test/functional/cms/home_controller_test.rb | 5 ++++- test/minitest_helper.rb | 2 +- test/unit/behaviors/dynamic_attributes_test.rb | 4 ++-- test/unit/models/task_test.rb | 10 +++++----- 18 files changed, 48 insertions(+), 27 deletions(-) create mode 100644 features/support/minitest.rb diff --git a/Gemfile b/Gemfile index 978ccb0a5..fa40fb1b3 100644 --- a/Gemfile +++ b/Gemfile @@ -28,9 +28,11 @@ group :development do gem 'quiet_assets' gem 'better_errors' gem 'binding_of_caller' + gem 'pry' end group :test, :development do gem 'minitest', '~>5.3.3' + gem "test-unit", "~> 3.0" gem 'minitest-rails', '~>2.0.0' gem 'minitest-reporters', '~>1.0.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 3109caca4..0647a5d89 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -14,7 +14,7 @@ PATH paperclip (~> 3.4) rails (~> 4.2.0) sass-rails - simple_form (>= 3.0.0.rc, < 3.1) + simple_form (~> 3.1.0) term-ansicolor underscore-rails (~> 1.4) will_paginate (~> 3.0.0) @@ -206,6 +206,11 @@ GEM capybara (~> 2.1.0) faye-websocket (>= 0.4.4, < 0.5.0) http_parser.rb (~> 0.5.3) + power_assert (1.0.1) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) quiet_assets (1.0.2) railties (>= 3.1, < 5.0) rack (1.6.5) @@ -252,11 +257,12 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) - simple_form (3.1.0.rc2) + simple_form (3.1.1) actionpack (~> 4.0) activemodel (~> 4.0) single_test (0.6.0) rake + slop (3.6.0) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -269,6 +275,8 @@ GEM sqlite3 (>= 1.3.3) term-ansicolor (1.4.0) tins (~> 1.0) + test-unit (3.2.3) + power_assert thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -312,6 +320,7 @@ DEPENDENCIES mocha mysql2 poltergeist + pry quiet_assets rake ruby-prof @@ -319,6 +328,7 @@ DEPENDENCIES single_test sprockets-rails (~> 2.3.1) sqlite3-ruby + test-unit (~> 3.0) thin uglifier yard diff --git a/Rakefile b/Rakefile index ec13f40c5..1d0892159 100644 --- a/Rakefile +++ b/Rakefile @@ -91,7 +91,6 @@ def run_tests(tests_to_run) Rake::Task[task].invoke nil rescue => e - puts e {:task => task, :exception => e} end end.compact diff --git a/app/models/cms/page.rb b/app/models/cms/page.rb index bfb7cf085..03e95673f 100644 --- a/app/models/cms/page.rb +++ b/app/models/cms/page.rb @@ -370,8 +370,8 @@ def connectable_count_for_container(container) end def name_with_section_path - a = ancestors - (a[1..a.size].map { |a| a.name } + [name]).join(" / ") + anc = ancestors + (anc[1..anc.size].map { |a| a.name } + [name]).join(" / ") end # @return [Boolean] true if this page is the home page of the site. diff --git a/browsercms.gemspec b/browsercms.gemspec index 72b6ccdfd..b90fbd7fa 100644 --- a/browsercms.gemspec +++ b/browsercms.gemspec @@ -44,7 +44,7 @@ Gem::Specification.new do |s| s.add_dependency("panoramic") s.add_dependency("will_paginate", "~>3.0.0") s.add_dependency("actionpack-page_caching", "~>1.0") - s.add_dependency("simple_form", ">= 3.0.0.rc", "< 3.1") + s.add_dependency("simple_form", "~>3.1.0") # Required only for bcms-upgrade s.add_dependency "term-ansicolor" diff --git a/features/commands/generate_module.feature b/features/commands/generate_module.feature index 55776df49..0addde700 100644 --- a/features/commands/generate_module.feature +++ b/features/commands/generate_module.feature @@ -9,7 +9,7 @@ Feature: Generate Module @known-bug Scenario: Create a BrowserCMS module When I create a module named "bcms_store" - Then a rails engine named "bcms_store" should exist + Then "bcms_store" should exist And BrowserCMS should be added the .gemspec file And a file named "bcms_store/test/dummy/app/views/layouts/templates/default.html.erb" should exist diff --git a/features/support/env.rb b/features/support/env.rb index 1e466f489..a2dc37033 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -17,6 +17,8 @@ #Capybara.javascript_driver = :poltergeist #Capybara.default_driver = :poltergeist + + Before do # Configure where Aruba generates files. # You can't generate rails projects within rails projects', so it needs to be parallel to the browsercms project @@ -84,3 +86,5 @@ require File.join(File.dirname(__FILE__), '../../db/seeds.rb') end +require 'test/unit/assertions' +World Test::Unit::Assertions diff --git a/features/support/minitest.rb b/features/support/minitest.rb new file mode 100644 index 000000000..08f405d01 --- /dev/null +++ b/features/support/minitest.rb @@ -0,0 +1,2 @@ +require 'minitest/unit' +World(MiniTest::Assertions) \ No newline at end of file diff --git a/lib/cms/behaviors/publishing.rb b/lib/cms/behaviors/publishing.rb index e4037751a..d2f459d7e 100644 --- a/lib/cms/behaviors/publishing.rb +++ b/lib/cms/behaviors/publishing.rb @@ -42,7 +42,6 @@ def is_publishable(options={}) module ClassMethods end module InstanceMethods - # Can specify whether to save this block as a draft using a terser syntax. # These two calls behave identically # - Cms::HtmlBlock.create(name: "Shorter", as: :draft) @@ -152,7 +151,7 @@ def publish! self.class.connection.update( "UPDATE #{self.class.quoted_table_name} " + "SET published = #{self.class.connection.quote(true, self.class.columns_hash["published"])} " + - "WHERE #{self.class.connection.quote_column_name(self.class.primary_key)} = #{self.class.quote_value(id)}", + "WHERE #{self.class.connection.quote_column_name(self.class.primary_key)} = #{self.class.quote_value(id, nil)}", "#{self.class.name.demodulize} Publish" ) did_publish = true diff --git a/lib/cms/behaviors/soft_deleting.rb b/lib/cms/behaviors/soft_deleting.rb index 51e0f5309..721c9b46b 100644 --- a/lib/cms/behaviors/soft_deleting.rb +++ b/lib/cms/behaviors/soft_deleting.rb @@ -91,7 +91,7 @@ def mark_as_deleted! end def destroy! - transaction { super.destroy } + transaction { super.destroy if super!=true } end def destroyed? diff --git a/lib/cms/behaviors/taggable.rb b/lib/cms/behaviors/taggable.rb index ceabbbd13..a94967682 100644 --- a/lib/cms/behaviors/taggable.rb +++ b/lib/cms/behaviors/taggable.rb @@ -44,7 +44,9 @@ def tag_list end def tag_list=(tag_names) + self.send("#{attributes.keys.last}_will_change!") @tag_list = tag_names unless @tag_list == tag_names + end def save_tags diff --git a/lib/cms/behaviors/versioning.rb b/lib/cms/behaviors/versioning.rb index e2025e4c9..093f5d415 100644 --- a/lib/cms/behaviors/versioning.rb +++ b/lib/cms/behaviors/versioning.rb @@ -14,7 +14,7 @@ module Behaviors # Represents a record as of a specific version in the versions table. module VersionRecord - + require 'pry' # Create an original 'record' of the Versioned about as it existed as of this VersionRecord. # # @return [Object] i.e. HtmlBlock @@ -222,6 +222,7 @@ def default_version_comment def create_or_update logger.debug { "#{self.class}#create_or_update called. Published = #{!!publish_on_save}" } self.skip_callbacks = false + #binding.pry unless different_from_last_draft? logger.debug { "No difference between this version and last. Skipping save" } self.skip_callbacks = true @@ -344,10 +345,12 @@ def version_comment def version_comment=(version_comment) @version_comment = version_comment + # This is not a great solution. We need to rethink how versioning is done, but for the time being + # forcing a random field on the object as dirty should solve the problem of attempting to write to + # the frozen changed attributes hash. + self.updated_by_id_will_change! + #binding.pry #send(:changed_attributes)["version_comment"] = @version_comment - #attr_name = "version_comment" - #self.send("#{attr_name}_will_change!") - #self.version_comment = @version_comment end def different_from_last_draft? diff --git a/spec/cms/form_fields_spec.rb b/spec/cms/form_fields_spec.rb index fbfcd9b95..aee6976f5 100644 --- a/spec/cms/form_fields_spec.rb +++ b/spec/cms/form_fields_spec.rb @@ -1,5 +1,5 @@ require "minitest_helper" -require 'mocha' +require 'mocha/setup' describe Cms::FormField do describe '.permitted_params' do diff --git a/spec/concerns/addressable_spec.rb b/spec/concerns/addressable_spec.rb index 838142b2f..53d32614b 100644 --- a/spec/concerns/addressable_spec.rb +++ b/spec/concerns/addressable_spec.rb @@ -71,9 +71,6 @@ def create_testing_table(name, &block) WannabeAddressable.expects(:has_one) WannabeAddressable.expects(:after_save) WannabeAddressable.expects(:after_validation) - puts "heres info" - puts WannabeAddressable.class - puts WannabeAddressable.to_yaml WannabeAddressable.is_addressable WannabeAddressable.new.must_respond_to :parent end diff --git a/test/functional/cms/home_controller_test.rb b/test/functional/cms/home_controller_test.rb index b44ae5cfd..79158bc85 100644 --- a/test/functional/cms/home_controller_test.rb +++ b/test/functional/cms/home_controller_test.rb @@ -54,10 +54,13 @@ def test_url_with_cms_domain_prefix_with_cms_site_www @request.path = "/cms" assert_equal "http://www.cms.foo.com/cms", @controller.send(:url_with_cms_domain_prefix) end - + require 'pry' def test_redirected_to_cms_site_if_public_site + binding.pry @request.host = "foo.com" + binding.pry get :index + binding.pry assert_redirected_to "http://foo.com/cms/login" end diff --git a/test/minitest_helper.rb b/test/minitest_helper.rb index 59c54ad24..bc006889d 100644 --- a/test/minitest_helper.rb +++ b/test/minitest_helper.rb @@ -35,7 +35,7 @@ class Minitest::Spec include FactoryHelpers end -require 'mocha' +require 'mocha/setup' #class MiniTest::Rails::ActiveSupport::TestCase diff --git a/test/unit/behaviors/dynamic_attributes_test.rb b/test/unit/behaviors/dynamic_attributes_test.rb index 988a4f386..ed6849b29 100644 --- a/test/unit/behaviors/dynamic_attributes_test.rb +++ b/test/unit/behaviors/dynamic_attributes_test.rb @@ -37,7 +37,7 @@ def setup test "can just call properties into existance" do @thing.price = 1 - assert_equal(1, @thing.price) + assert_equal(1, @thing.price.to_i) end test "Can persist String properties" do @@ -62,7 +62,7 @@ def setup test "can bulk set attributes=" do @thing.attributes=({:price=>1, :description=>"Paper"}) - assert_equal(1, @thing.price) + assert_equal(1, @thing.price.to_i) assert_equal("Paper", @thing.description) end diff --git a/test/unit/models/task_test.rb b/test/unit/models/task_test.rb index b83a81283..81cd47a7c 100644 --- a/test/unit/models/task_test.rb +++ b/test/unit/models/task_test.rb @@ -13,6 +13,11 @@ def setup end class CreateTaskTest < TaskTest + test "An email is sent when a task is created" do + deliveries_before_task_creation = ActionMailer::Base.deliveries.size + create_the_task! + assert_equal 1, ActionMailer::Base.deliveries.size - deliveries_before_task_creation + end def test_create_task assert_that_you_can_assign_a_task_to_yourself @@ -43,11 +48,6 @@ def test_create_task assert_equal "http://cms.browsercms.org#{@page.path}\n\n#{@task.comment}", email.body end - test "An email is sent when a task is created" do - create_the_task! - - assert_equal 1, ActionMailer::Base.deliveries.size - end protected From 7314a8b0cf5b70d0197e962a6c8e553e4ba014c7 Mon Sep 17 00:00:00 2001 From: Justin Windholtz Date: Thu, 23 Mar 2017 00:54:26 -0400 Subject: [PATCH 13/13] resolves more tests --- Gemfile.lock | 96 ++--- Rakefile | 4 +- .../cms/{_assets.css.scss => _assets.scss} | 0 .../cms/{_base.css.scss => _base.scss} | 0 ...cms-buttons.css.scss => _cms-buttons.scss} | 0 .../{_cms-forms.css.scss => _cms-forms.scss} | 0 .../cms/{_colors.css.scss => _colors.scss} | 0 .../{_dashboard.css.scss => _dashboard.scss} | 0 .../cms/{_glyph.css.scss => _glyph.scss} | 0 .../{_main-area.css.scss => _main-area.scss} | 0 .../cms/{_nav.css.scss => _nav.scss} | 0 .../cms/{_sidebar.css.scss => _sidebar.scss} | 0 .../cms/{_sitemap.css.scss => _sitemap.scss} | 0 .../cms/{_submenu.css.scss => _submenu.scss} | 0 ...{application.css.scss => application.scss} | 0 .../cms/{core.css.scss => core.scss} | 0 ...ault-forms.css.scss => default-forms.scss} | 0 .../{_animation.css.scss => _animation.scss} | 0 .../cms/includes/{_rem.css.scss => _rem.scss} | 0 .../{_animate.css.scss => _animate.scss} | 0 .../animation/{_core.css.scss => _core.scss} | 0 .../{_shared.css.scss => _shared.scss} | 0 ...ekers.css.scss => _attention-seekers.scss} | 0 .../{_bouncing.css.scss => _bouncing.scss} | 0 .../{_classes.css.scss => _classes.scss} | 0 .../{_fading.css.scss => _fading.scss} | 0 .../{_flippers.css.scss => _flippers.scss} | 0 ...{_lightspeed.css.scss => _lightspeed.scss} | 0 .../{_rotating.css.scss => _rotating.scss} | 0 .../{_specials.css.scss => _specials.scss} | 0 ...nces.css.scss => _bouncing-entrances.scss} | 0 ...ng-exits.css.scss => _bouncing-exits.scss} | 0 ...rances.css.scss => _fading-entrances.scss} | 0 ...ding-exits.css.scss => _fading-exits.scss} | 0 ...nces.css.scss => _rotating-entrances.scss} | 0 ...ng-exits.css.scss => _rotating-exits.scss} | 0 ...ing.css.scss => page_content_editing.scss} | 0 ...{page_editor.css.scss => page_editor.scss} | 0 .../cms/{style.css.scss => style.scss} | 0 .../styles/{_alerts.css.scss => _alerts.scss} | 0 .../{_base-grid.css.scss => _base-grid.scss} | 0 .../{_buttons.css.scss => _buttons.scss} | 0 .../{_dropdown.css.scss => _dropdown.scss} | 0 .../styles/{_forms.css.scss => _forms.scss} | 0 .../styles/{_glyph.css.scss => _glyph.scss} | 0 .../styles/{_images.css.scss => _images.scss} | 0 .../styles/{_lists.css.scss => _lists.scss} | 0 .../styles/{_modal.css.scss => _modal.scss} | 0 .../{_progress.css.scss => _progress.scss} | 0 .../styles/{_tables.css.scss => _tables.scss} | 0 .../cms/styles/{_text.css.scss => _text.scss} | 0 .../attachments/_attachment_manager.html.erb | 2 +- config/routes.rb | 2 +- features/content_pages.feature | 2 +- features/manage_page_routes.feature | 2 +- features/step_definitions/image_steps.rb | 3 +- features/step_definitions/web_steps.rb | 8 +- gemfilebck.lock | 340 ++++++++++++++++++ lib/cms/behaviors/versioning.rb | 1 - lib/cms/concerns/can_be_addressable.rb | 2 +- lib/cms/engine_helper.rb | 1 - lib/cms/version.rb | 2 +- spec/concerns/addressable_spec.rb | 20 +- test/functional/cms/home_controller_test.rb | 6 +- test/unit/behaviors/rendering_test.rb | 11 +- test/unit/lib/content_block_test.rb | 8 +- test/unit/models/html_block_test.rb | 6 - test/unit/models/sections_test.rb | 1 - 68 files changed, 427 insertions(+), 90 deletions(-) rename app/assets/stylesheets/cms/{_assets.css.scss => _assets.scss} (100%) rename app/assets/stylesheets/cms/{_base.css.scss => _base.scss} (100%) rename app/assets/stylesheets/cms/{_cms-buttons.css.scss => _cms-buttons.scss} (100%) rename app/assets/stylesheets/cms/{_cms-forms.css.scss => _cms-forms.scss} (100%) rename app/assets/stylesheets/cms/{_colors.css.scss => _colors.scss} (100%) rename app/assets/stylesheets/cms/{_dashboard.css.scss => _dashboard.scss} (100%) rename app/assets/stylesheets/cms/{_glyph.css.scss => _glyph.scss} (100%) rename app/assets/stylesheets/cms/{_main-area.css.scss => _main-area.scss} (100%) rename app/assets/stylesheets/cms/{_nav.css.scss => _nav.scss} (100%) rename app/assets/stylesheets/cms/{_sidebar.css.scss => _sidebar.scss} (100%) rename app/assets/stylesheets/cms/{_sitemap.css.scss => _sitemap.scss} (100%) rename app/assets/stylesheets/cms/{_submenu.css.scss => _submenu.scss} (100%) rename app/assets/stylesheets/cms/{application.css.scss => application.scss} (100%) rename app/assets/stylesheets/cms/{core.css.scss => core.scss} (100%) rename app/assets/stylesheets/cms/{default-forms.css.scss => default-forms.scss} (100%) rename app/assets/stylesheets/cms/includes/{_animation.css.scss => _animation.scss} (100%) rename app/assets/stylesheets/cms/includes/{_rem.css.scss => _rem.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/{_animate.css.scss => _animate.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/{_core.css.scss => _core.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/{_shared.css.scss => _shared.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_attention-seekers.css.scss => _attention-seekers.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_bouncing.css.scss => _bouncing.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_classes.css.scss => _classes.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_fading.css.scss => _fading.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_flippers.css.scss => _flippers.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_lightspeed.css.scss => _lightspeed.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_rotating.css.scss => _rotating.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/{_specials.css.scss => _specials.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/bouncing/{_bouncing-entrances.css.scss => _bouncing-entrances.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/bouncing/{_bouncing-exits.css.scss => _bouncing-exits.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/fading/{_fading-entrances.css.scss => _fading-entrances.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/fading/{_fading-exits.css.scss => _fading-exits.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/rotating/{_rotating-entrances.css.scss => _rotating-entrances.scss} (100%) rename app/assets/stylesheets/cms/includes/animation/animate/rotating/{_rotating-exits.css.scss => _rotating-exits.scss} (100%) rename app/assets/stylesheets/cms/{page_content_editing.css.scss => page_content_editing.scss} (100%) rename app/assets/stylesheets/cms/{page_editor.css.scss => page_editor.scss} (100%) rename app/assets/stylesheets/cms/{style.css.scss => style.scss} (100%) rename app/assets/stylesheets/cms/styles/{_alerts.css.scss => _alerts.scss} (100%) rename app/assets/stylesheets/cms/styles/{_base-grid.css.scss => _base-grid.scss} (100%) rename app/assets/stylesheets/cms/styles/{_buttons.css.scss => _buttons.scss} (100%) rename app/assets/stylesheets/cms/styles/{_dropdown.css.scss => _dropdown.scss} (100%) rename app/assets/stylesheets/cms/styles/{_forms.css.scss => _forms.scss} (100%) rename app/assets/stylesheets/cms/styles/{_glyph.css.scss => _glyph.scss} (100%) rename app/assets/stylesheets/cms/styles/{_images.css.scss => _images.scss} (100%) rename app/assets/stylesheets/cms/styles/{_lists.css.scss => _lists.scss} (100%) rename app/assets/stylesheets/cms/styles/{_modal.css.scss => _modal.scss} (100%) rename app/assets/stylesheets/cms/styles/{_progress.css.scss => _progress.scss} (100%) rename app/assets/stylesheets/cms/styles/{_tables.css.scss => _tables.scss} (100%) rename app/assets/stylesheets/cms/styles/{_text.css.scss => _text.scss} (100%) create mode 100644 gemfilebck.lock diff --git a/Gemfile.lock b/Gemfile.lock index 0647a5d89..346d65b37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - browsercms (4.0.0.rc1) + browsercms (4.2.8.rc1) actionpack-page_caching (~> 1.0) ancestry (~> 2.0.0) bootstrap-sass @@ -58,16 +58,20 @@ GEM minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - addressable (2.3.5) + addressable (2.5.0) + public_suffix (~> 2.0, >= 2.0.2) ancestry (2.0.0) activerecord (>= 3.0.0) ansi (1.5.0) arel (6.0.4) - aruba (0.5.3) - childprocess (>= 0.3.6) - cucumber (>= 1.1.1) - rspec-expectations (>= 2.7.0) - autoprefixer-rails (6.7.7) + aruba (0.14.2) + childprocess (~> 0.5.6) + contracts (~> 0.9) + cucumber (>= 1.3.19) + ffi (~> 1.9.10) + rspec-expectations (>= 2.99) + thor (~> 0.19) + autoprefixer-rails (6.7.7.1) execjs bcrypt (3.1.11) better_errors (2.1.1) @@ -81,21 +85,23 @@ GEM autoprefixer-rails (>= 5.2.1) sass (>= 3.3.4) builder (3.2.3) - capybara (2.1.0) + capybara (2.13.0) + addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - childprocess (0.3.9) + childprocess (0.5.9) ffi (~> 1.0, >= 1.0.11) chunky_png (1.3.8) ckeditor_rails (4.3.4) railties (>= 3.0) climate_control (0.1.0) + cliver (0.3.2) cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) - coderay (1.1.0) + coderay (1.1.1) compass (1.0.3) chunky_png (~> 1.2) compass-core (~> 1.0.2) @@ -113,6 +119,7 @@ GEM sass-rails (< 5.1) sprockets (< 4.0) concurrent-ruby (1.0.5) + contracts (0.15.0) cucumber (2.4.0) builder (>= 2.1.2) cucumber-core (~> 1.5.0) @@ -130,8 +137,8 @@ GEM nokogiri (~> 1.5) railties (>= 3, < 5.1) cucumber-wire (0.0.1) - daemons (1.1.9) - database_cleaner (1.2.0) + daemons (1.2.4) + database_cleaner (1.5.3) debug_inspector (0.0.2) devise (3.5.10) bcrypt (~> 3.0) @@ -142,37 +149,33 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) erubis (2.7.0) - eventmachine (1.0.3) - execjs (1.4.0) - multi_json (~> 1.0) + eventmachine (1.2.3) + execjs (2.7.0) factory_girl (3.3.0) activesupport (>= 3.0.0) factory_girl_rails (3.3.0) factory_girl (~> 3.3.0) railties (>= 3.0.0) - faye-websocket (0.4.7) - eventmachine (>= 0.12.0) - ffi (1.9.0) - gherkin (4.0.0) + ffi (1.9.18) + gherkin (4.1.1) globalid (0.3.7) activesupport (>= 4.1.0) - http_parser.rb (0.5.3) i18n (0.8.1) jquery-rails (3.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) jquery-ui-rails (4.2.1) railties (>= 3.2.16) - launchy (2.3.0) + launchy (2.4.3) addressable (~> 2.3) loofah (2.0.3) nokogiri (>= 1.5.9) - m (1.3.2) + m (1.5.0) method_source (>= 0.6.7) rake (>= 0.9.2.2) mail (2.6.4) mime-types (>= 1.16, < 4) - metaclass (0.0.1) + metaclass (0.0.4) method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) @@ -187,11 +190,11 @@ GEM builder minitest (>= 5.0) ruby-progressbar - mocha (0.14.0) + mocha (1.2.1) metaclass (~> 0.0.1) multi_json (1.12.1) multi_test (0.1.2) - mysql2 (0.3.13) + mysql2 (0.4.5) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) orm_adapter (0.5.0) @@ -202,16 +205,17 @@ GEM activesupport (>= 3.0.0) cocaine (~> 0.5.3) mime-types - poltergeist (1.3.0) - capybara (~> 2.1.0) - faye-websocket (>= 0.4.4, < 0.5.0) - http_parser.rb (~> 0.5.3) + poltergeist (1.14.0) + capybara (~> 2.1) + cliver (~> 0.3.1) + websocket-driver (>= 0.2.0) power_assert (1.0.1) pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - quiet_assets (1.0.2) + public_suffix (2.0.5) + quiet_assets (1.1.0) railties (>= 3.1, < 5.0) rack (1.6.5) rack-test (0.6.3) @@ -246,9 +250,11 @@ GEM ffi (>= 0.5.0) responders (2.3.0) railties (>= 4.2.0, < 5.1) - rspec-expectations (2.14.1) - diff-lcs (>= 1.1.3, < 2.0) - ruby-prof (0.13.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + ruby-prof (0.16.2) ruby-progressbar (1.8.1) sass (3.4.23) sass-rails (5.0.6) @@ -270,33 +276,35 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.7) + sqlite3 (1.3.13) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) - term-ansicolor (1.4.0) + term-ansicolor (1.4.1) tins (~> 1.0) test-unit (3.2.3) power_assert - thin (1.5.1) - daemons (>= 1.0.9) - eventmachine (>= 0.12.6) - rack (>= 1.0.0) + thin (1.7.0) + daemons (~> 1.0, >= 1.0.9) + eventmachine (~> 1.0, >= 1.0.4) + rack (>= 1, < 3) thor (0.19.4) thread_safe (0.3.6) - tilt (2.0.6) + tilt (2.0.7) tins (1.13.2) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (2.1.2) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + uglifier (3.1.9) + execjs (>= 0.3.0, < 3) underscore-rails (1.8.3) warden (1.2.7) rack (>= 1.0) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.2) will_paginate (3.0.12) xpath (2.0.0) nokogiri (~> 1.3) - yard (0.8.7) + yard (0.9.8) PLATFORMS ruby diff --git a/Rakefile b/Rakefile index 1d0892159..1c5d548a8 100644 --- a/Rakefile +++ b/Rakefile @@ -26,12 +26,14 @@ Rake::TestTask.new('units') do |t| t.libs << 'test' t.pattern = 'test/unit/**/*_test.rb' t.verbose = false + t.warning = false end Rake::TestTask.new('spec') do |t| t.libs << 'lib' t.libs << 'spec' t.pattern = "spec/**/*_spec.rb" + t.warning = false end Rake::TestTask.new('test:functionals' => ['project:ensure_db_exists', 'app:test:prepare']) do |t| @@ -39,7 +41,7 @@ Rake::TestTask.new('test:functionals' => ['project:ensure_db_exists', 'app:test: t.libs << 'test' t.pattern = 'test/functional/**/*_test.rb' t.verbose = false - + t.warning = false end require 'cucumber' diff --git a/app/assets/stylesheets/cms/_assets.css.scss b/app/assets/stylesheets/cms/_assets.scss similarity index 100% rename from app/assets/stylesheets/cms/_assets.css.scss rename to app/assets/stylesheets/cms/_assets.scss diff --git a/app/assets/stylesheets/cms/_base.css.scss b/app/assets/stylesheets/cms/_base.scss similarity index 100% rename from app/assets/stylesheets/cms/_base.css.scss rename to app/assets/stylesheets/cms/_base.scss diff --git a/app/assets/stylesheets/cms/_cms-buttons.css.scss b/app/assets/stylesheets/cms/_cms-buttons.scss similarity index 100% rename from app/assets/stylesheets/cms/_cms-buttons.css.scss rename to app/assets/stylesheets/cms/_cms-buttons.scss diff --git a/app/assets/stylesheets/cms/_cms-forms.css.scss b/app/assets/stylesheets/cms/_cms-forms.scss similarity index 100% rename from app/assets/stylesheets/cms/_cms-forms.css.scss rename to app/assets/stylesheets/cms/_cms-forms.scss diff --git a/app/assets/stylesheets/cms/_colors.css.scss b/app/assets/stylesheets/cms/_colors.scss similarity index 100% rename from app/assets/stylesheets/cms/_colors.css.scss rename to app/assets/stylesheets/cms/_colors.scss diff --git a/app/assets/stylesheets/cms/_dashboard.css.scss b/app/assets/stylesheets/cms/_dashboard.scss similarity index 100% rename from app/assets/stylesheets/cms/_dashboard.css.scss rename to app/assets/stylesheets/cms/_dashboard.scss diff --git a/app/assets/stylesheets/cms/_glyph.css.scss b/app/assets/stylesheets/cms/_glyph.scss similarity index 100% rename from app/assets/stylesheets/cms/_glyph.css.scss rename to app/assets/stylesheets/cms/_glyph.scss diff --git a/app/assets/stylesheets/cms/_main-area.css.scss b/app/assets/stylesheets/cms/_main-area.scss similarity index 100% rename from app/assets/stylesheets/cms/_main-area.css.scss rename to app/assets/stylesheets/cms/_main-area.scss diff --git a/app/assets/stylesheets/cms/_nav.css.scss b/app/assets/stylesheets/cms/_nav.scss similarity index 100% rename from app/assets/stylesheets/cms/_nav.css.scss rename to app/assets/stylesheets/cms/_nav.scss diff --git a/app/assets/stylesheets/cms/_sidebar.css.scss b/app/assets/stylesheets/cms/_sidebar.scss similarity index 100% rename from app/assets/stylesheets/cms/_sidebar.css.scss rename to app/assets/stylesheets/cms/_sidebar.scss diff --git a/app/assets/stylesheets/cms/_sitemap.css.scss b/app/assets/stylesheets/cms/_sitemap.scss similarity index 100% rename from app/assets/stylesheets/cms/_sitemap.css.scss rename to app/assets/stylesheets/cms/_sitemap.scss diff --git a/app/assets/stylesheets/cms/_submenu.css.scss b/app/assets/stylesheets/cms/_submenu.scss similarity index 100% rename from app/assets/stylesheets/cms/_submenu.css.scss rename to app/assets/stylesheets/cms/_submenu.scss diff --git a/app/assets/stylesheets/cms/application.css.scss b/app/assets/stylesheets/cms/application.scss similarity index 100% rename from app/assets/stylesheets/cms/application.css.scss rename to app/assets/stylesheets/cms/application.scss diff --git a/app/assets/stylesheets/cms/core.css.scss b/app/assets/stylesheets/cms/core.scss similarity index 100% rename from app/assets/stylesheets/cms/core.css.scss rename to app/assets/stylesheets/cms/core.scss diff --git a/app/assets/stylesheets/cms/default-forms.css.scss b/app/assets/stylesheets/cms/default-forms.scss similarity index 100% rename from app/assets/stylesheets/cms/default-forms.css.scss rename to app/assets/stylesheets/cms/default-forms.scss diff --git a/app/assets/stylesheets/cms/includes/_animation.css.scss b/app/assets/stylesheets/cms/includes/_animation.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/_animation.css.scss rename to app/assets/stylesheets/cms/includes/_animation.scss diff --git a/app/assets/stylesheets/cms/includes/_rem.css.scss b/app/assets/stylesheets/cms/includes/_rem.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/_rem.css.scss rename to app/assets/stylesheets/cms/includes/_rem.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_animate.css.scss b/app/assets/stylesheets/cms/includes/animation/_animate.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_animate.css.scss rename to app/assets/stylesheets/cms/includes/animation/_animate.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_core.css.scss b/app/assets/stylesheets/cms/includes/animation/_core.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_core.css.scss rename to app/assets/stylesheets/cms/includes/animation/_core.scss diff --git a/app/assets/stylesheets/cms/includes/animation/_shared.css.scss b/app/assets/stylesheets/cms/includes/animation/_shared.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/_shared.css.scss rename to app/assets/stylesheets/cms/includes/animation/_shared.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_bouncing.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_classes.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_classes.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_classes.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_classes.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_fading.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_fading.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_fading.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_fading.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_flippers.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_flippers.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_rotating.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_rotating.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/_specials.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/_specials.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/_specials.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/_specials.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss diff --git a/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.css.scss b/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss similarity index 100% rename from app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.css.scss rename to app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss diff --git a/app/assets/stylesheets/cms/page_content_editing.css.scss b/app/assets/stylesheets/cms/page_content_editing.scss similarity index 100% rename from app/assets/stylesheets/cms/page_content_editing.css.scss rename to app/assets/stylesheets/cms/page_content_editing.scss diff --git a/app/assets/stylesheets/cms/page_editor.css.scss b/app/assets/stylesheets/cms/page_editor.scss similarity index 100% rename from app/assets/stylesheets/cms/page_editor.css.scss rename to app/assets/stylesheets/cms/page_editor.scss diff --git a/app/assets/stylesheets/cms/style.css.scss b/app/assets/stylesheets/cms/style.scss similarity index 100% rename from app/assets/stylesheets/cms/style.css.scss rename to app/assets/stylesheets/cms/style.scss diff --git a/app/assets/stylesheets/cms/styles/_alerts.css.scss b/app/assets/stylesheets/cms/styles/_alerts.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_alerts.css.scss rename to app/assets/stylesheets/cms/styles/_alerts.scss diff --git a/app/assets/stylesheets/cms/styles/_base-grid.css.scss b/app/assets/stylesheets/cms/styles/_base-grid.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_base-grid.css.scss rename to app/assets/stylesheets/cms/styles/_base-grid.scss diff --git a/app/assets/stylesheets/cms/styles/_buttons.css.scss b/app/assets/stylesheets/cms/styles/_buttons.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_buttons.css.scss rename to app/assets/stylesheets/cms/styles/_buttons.scss diff --git a/app/assets/stylesheets/cms/styles/_dropdown.css.scss b/app/assets/stylesheets/cms/styles/_dropdown.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_dropdown.css.scss rename to app/assets/stylesheets/cms/styles/_dropdown.scss diff --git a/app/assets/stylesheets/cms/styles/_forms.css.scss b/app/assets/stylesheets/cms/styles/_forms.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_forms.css.scss rename to app/assets/stylesheets/cms/styles/_forms.scss diff --git a/app/assets/stylesheets/cms/styles/_glyph.css.scss b/app/assets/stylesheets/cms/styles/_glyph.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_glyph.css.scss rename to app/assets/stylesheets/cms/styles/_glyph.scss diff --git a/app/assets/stylesheets/cms/styles/_images.css.scss b/app/assets/stylesheets/cms/styles/_images.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_images.css.scss rename to app/assets/stylesheets/cms/styles/_images.scss diff --git a/app/assets/stylesheets/cms/styles/_lists.css.scss b/app/assets/stylesheets/cms/styles/_lists.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_lists.css.scss rename to app/assets/stylesheets/cms/styles/_lists.scss diff --git a/app/assets/stylesheets/cms/styles/_modal.css.scss b/app/assets/stylesheets/cms/styles/_modal.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_modal.css.scss rename to app/assets/stylesheets/cms/styles/_modal.scss diff --git a/app/assets/stylesheets/cms/styles/_progress.css.scss b/app/assets/stylesheets/cms/styles/_progress.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_progress.css.scss rename to app/assets/stylesheets/cms/styles/_progress.scss diff --git a/app/assets/stylesheets/cms/styles/_tables.css.scss b/app/assets/stylesheets/cms/styles/_tables.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_tables.css.scss rename to app/assets/stylesheets/cms/styles/_tables.scss diff --git a/app/assets/stylesheets/cms/styles/_text.css.scss b/app/assets/stylesheets/cms/styles/_text.scss similarity index 100% rename from app/assets/stylesheets/cms/styles/_text.css.scss rename to app/assets/stylesheets/cms/styles/_text.scss diff --git a/app/views/cms/attachments/_attachment_manager.html.erb b/app/views/cms/attachments/_attachment_manager.html.erb index 631b24cd9..10706637b 100644 --- a/app/views/cms/attachments/_attachment_manager.html.erb +++ b/app/views/cms/attachments/_attachment_manager.html.erb @@ -12,7 +12,7 @@