comfortable_mexican_sofa 1.8.5 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/.travis.yml +3 -3
- data/README.md +10 -14
- data/Rakefile +0 -2
- data/app/assets/javascripts/comfortable_mexican_sofa/application.js.coffee +1 -2
- data/app/controllers/cms_admin/base_controller.rb +1 -1
- data/app/controllers/cms_admin/categories_controller.rb +7 -3
- data/app/controllers/cms_admin/files_controller.rb +28 -32
- data/app/controllers/cms_admin/layouts_controller.rb +12 -7
- data/app/controllers/cms_admin/pages_controller.rb +14 -10
- data/app/controllers/cms_admin/revisions_controller.rb +2 -2
- data/app/controllers/cms_admin/sites_controller.rb +9 -5
- data/app/controllers/cms_admin/snippets_controller.rb +8 -4
- data/app/controllers/cms_content_controller.rb +5 -5
- data/app/models/cms/block.rb +0 -3
- data/app/models/cms/categorization.rb +0 -2
- data/app/models/cms/category.rb +2 -4
- data/app/models/cms/file.rb +2 -10
- data/app/models/cms/layout.rb +2 -10
- data/app/models/cms/page.rb +2 -11
- data/app/models/cms/revision.rb +1 -3
- data/app/models/cms/site.rb +5 -12
- data/app/models/cms/snippet.rb +3 -8
- data/app/views/cms_admin/layouts/edit.html.haml +1 -1
- data/app/views/cms_admin/pages/_form_blocks.html.haml +1 -1
- data/app/views/cms_admin/pages/edit.html.haml +1 -1
- data/app/views/cms_admin/sites/_mirrors.html.haml +2 -1
- data/app/views/cms_admin/snippets/edit.html.haml +1 -1
- data/app/views/cms_content/render_sitemap.xml.builder +0 -1
- data/comfortable_mexican_sofa.gemspec +2 -2
- data/config/application.rb +5 -46
- data/config/boot.rb +2 -3
- data/config/cms_routes.rb +4 -0
- data/config/environments/development.rb +9 -21
- data/config/environments/test.rb +12 -15
- data/config/initializers/secret_token.rb +15 -0
- data/lib/comfortable_mexican_sofa.rb +0 -1
- data/lib/comfortable_mexican_sofa/extensions/acts_as_tree.rb +5 -4
- data/lib/comfortable_mexican_sofa/extensions/rails.rb +1 -1
- data/lib/comfortable_mexican_sofa/fixture.rb +4 -1
- data/lib/comfortable_mexican_sofa/fixture/category.rb +1 -1
- data/lib/comfortable_mexican_sofa/fixture/layout.rb +1 -1
- data/lib/comfortable_mexican_sofa/fixture/snippet.rb +1 -1
- data/lib/comfortable_mexican_sofa/routing.rb +0 -1
- data/lib/comfortable_mexican_sofa/tags/collection.rb +1 -1
- data/lib/comfortable_mexican_sofa/version.rb +1 -1
- data/lib/tasks/comfortable_mexican_sofa.rake +0 -5
- data/test/{functional → controllers}/cms_admin/base_controller_test.rb +0 -0
- data/test/{functional → controllers}/cms_admin/categories_controller_test.rb +0 -0
- data/test/{functional → controllers}/cms_admin/files_controller_test.rb +3 -17
- data/test/{functional → controllers}/cms_admin/layouts_controller_test.rb +9 -0
- data/test/{functional → controllers}/cms_admin/pages_controller_test.rb +19 -19
- data/test/{functional → controllers}/cms_admin/revisions_controller_test.rb +0 -0
- data/test/{functional → controllers}/cms_admin/sites_controller_test.rb +0 -0
- data/test/{functional → controllers}/cms_admin/snippets_controller_test.rb +0 -0
- data/test/{functional → controllers}/cms_content_controller_test.rb +6 -23
- data/test/gemfiles/Gemfile.rails.4.0 +17 -0
- data/test/integration/authentication_test.rb +1 -1
- data/test/integration/fixtures_test.rb +2 -2
- data/test/integration/mirrors_test.rb +2 -2
- data/test/integration/render_cms_test.rb +4 -10
- data/test/integration/sites_test.rb +4 -4
- data/test/integration/view_hooks_test.rb +1 -1
- data/test/{unit/models → models/cms}/block_test.rb +3 -3
- data/test/{unit/models → models/cms}/categorization_test.rb +2 -2
- data/test/{unit/models → models/cms}/category_test.rb +0 -0
- data/test/{unit/models → models/cms}/file_test.rb +1 -1
- data/test/{unit/models → models/cms}/layout_test.rb +2 -2
- data/test/{unit/models → models/cms}/page_test.rb +3 -3
- data/test/{unit/models → models/cms}/site_test.rb +1 -1
- data/test/{unit/models → models/cms}/snippet_test.rb +0 -0
- data/test/{unit → models}/configuration_test.rb +0 -0
- data/test/{unit → models}/fixtures/categories_test.rb +0 -0
- data/test/{unit → models}/fixtures/files_test.rb +0 -0
- data/test/{unit → models}/fixtures/layouts_test.rb +0 -0
- data/test/{unit → models}/fixtures/pages_test.rb +0 -0
- data/test/{unit → models}/fixtures/snippets_test.rb +0 -0
- data/test/{unit → models}/fixtures_test.rb +1 -1
- data/test/{unit → models}/mirrors_test.rb +0 -0
- data/test/{unit → models}/revisions_test.rb +0 -0
- data/test/{unit → models}/tag_test.rb +0 -0
- data/test/{unit → models}/tags/asset_test.rb +0 -0
- data/test/{unit → models}/tags/collection_test.rb +0 -0
- data/test/{unit → models}/tags/field_datetime_test.rb +0 -0
- data/test/{unit → models}/tags/field_integer_test.rb +0 -0
- data/test/{unit → models}/tags/field_rich_text_test.rb +0 -0
- data/test/{unit → models}/tags/field_string_test.rb +0 -0
- data/test/{unit → models}/tags/field_text_test.rb +0 -0
- data/test/{unit → models}/tags/file_test.rb +0 -0
- data/test/{unit → models}/tags/helper_test.rb +0 -0
- data/test/{unit → models}/tags/page_datetime_test.rb +0 -0
- data/test/{unit → models}/tags/page_file_test.rb +0 -0
- data/test/{unit → models}/tags/page_files_test.rb +0 -0
- data/test/{unit → models}/tags/page_integer_test.rb +0 -0
- data/test/{unit → models}/tags/page_markdown_test.rb +0 -0
- data/test/{unit → models}/tags/page_rich_text_test.rb +0 -0
- data/test/{unit → models}/tags/page_string_test.rb +0 -0
- data/test/{unit → models}/tags/page_text_test.rb +0 -0
- data/test/{unit → models}/tags/partial_test.rb +0 -0
- data/test/{unit → models}/tags/snippet_test.rb +0 -0
- data/test/{unit → models}/view_methods_test.rb +1 -1
- data/test/test_helper.rb +1 -16
- metadata +55 -59
- data/config/environments/production.rb +0 -67
- data/config/routes.rb +0 -4
- data/lib/comfortable_mexican_sofa/sitemap.rb +0 -27
- data/test/gemfiles/Gemfile.rails.3.1 +0 -19
- data/test/gemfiles/Gemfile.rails.3.2 +0 -19
- data/test/unit/fixtures/_sample.jpg.yml +0 -0
- data/test/unit/sitemap_test.rb +0 -20
data/app/models/cms/category.rb
CHANGED
@@ -4,9 +4,6 @@ class Cms::Category < ActiveRecord::Base
|
|
4
4
|
|
5
5
|
self.table_name = 'cms_categories'
|
6
6
|
|
7
|
-
attr_accessible :label,
|
8
|
-
:categorized_type
|
9
|
-
|
10
7
|
# -- Relationships --------------------------------------------------------
|
11
8
|
belongs_to :site
|
12
9
|
has_many :categorizations,
|
@@ -22,7 +19,8 @@ class Cms::Category < ActiveRecord::Base
|
|
22
19
|
:presence => true
|
23
20
|
|
24
21
|
# -- Scopes ---------------------------------------------------------------
|
25
|
-
default_scope order(:label)
|
22
|
+
default_scope{ order(:label) }
|
23
|
+
|
26
24
|
scope :of_type, lambda { |type|
|
27
25
|
where(:categorized_type => type)
|
28
26
|
}
|
data/app/models/cms/file.rb
CHANGED
@@ -10,14 +10,6 @@ class Cms::File < ActiveRecord::Base
|
|
10
10
|
|
11
11
|
attr_accessor :dimensions
|
12
12
|
|
13
|
-
attr_accessible :site, :site_id,
|
14
|
-
:file,
|
15
|
-
:dimensions,
|
16
|
-
:label,
|
17
|
-
:description,
|
18
|
-
:category_ids,
|
19
|
-
:position
|
20
|
-
|
21
13
|
# -- AR Extensions --------------------------------------------------------
|
22
14
|
has_attached_file :file, ComfortableMexicanSofa.config.upload_file_options.merge(
|
23
15
|
# dimensions accessor needs to be set before file assignment for this to work
|
@@ -49,8 +41,8 @@ class Cms::File < ActiveRecord::Base
|
|
49
41
|
after_destroy :reload_page_cache
|
50
42
|
|
51
43
|
# -- Scopes ---------------------------------------------------------------
|
52
|
-
scope :images, where(:file_content_type => IMAGE_MIMETYPES)
|
53
|
-
scope :not_images, where('file_content_type NOT IN (?)', IMAGE_MIMETYPES)
|
44
|
+
scope :images, -> { where(:file_content_type => IMAGE_MIMETYPES) }
|
45
|
+
scope :not_images, -> { where('file_content_type NOT IN (?)', IMAGE_MIMETYPES) }
|
54
46
|
|
55
47
|
# -- Instance Methods -----------------------------------------------------
|
56
48
|
def is_image?
|
data/app/models/cms/layout.rb
CHANGED
@@ -8,14 +8,6 @@ class Cms::Layout < ActiveRecord::Base
|
|
8
8
|
cms_is_mirrored
|
9
9
|
cms_has_revisions_for :content, :css, :js
|
10
10
|
|
11
|
-
attr_accessible :label,
|
12
|
-
:identifier,
|
13
|
-
:content,
|
14
|
-
:css,
|
15
|
-
:js,
|
16
|
-
:parent, :parent_id,
|
17
|
-
:app_layout
|
18
|
-
|
19
11
|
# -- Relationships --------------------------------------------------------
|
20
12
|
belongs_to :site
|
21
13
|
has_many :pages, :dependent => :nullify
|
@@ -34,10 +26,10 @@ class Cms::Layout < ActiveRecord::Base
|
|
34
26
|
validates :identifier,
|
35
27
|
:presence => true,
|
36
28
|
:uniqueness => { :scope => :site_id },
|
37
|
-
:format => { :with =>
|
29
|
+
:format => { :with => /\A\w[a-z0-9_-]*\z/i }
|
38
30
|
|
39
31
|
# -- Scopes ---------------------------------------------------------------
|
40
|
-
default_scope order('cms_layouts.position')
|
32
|
+
default_scope -> { order('cms_layouts.position') }
|
41
33
|
|
42
34
|
# -- Class Methods --------------------------------------------------------
|
43
35
|
# Tree-like structure for layouts
|
data/app/models/cms/page.rb
CHANGED
@@ -6,15 +6,6 @@ class Cms::Page < ActiveRecord::Base
|
|
6
6
|
|
7
7
|
self.table_name = 'cms_pages'
|
8
8
|
|
9
|
-
attr_accessible :layout, :layout_id,
|
10
|
-
:label,
|
11
|
-
:slug,
|
12
|
-
:parent, :parent_id,
|
13
|
-
:blocks_attributes,
|
14
|
-
:is_published,
|
15
|
-
:target_page_id,
|
16
|
-
:category_ids
|
17
|
-
|
18
9
|
cms_acts_as_tree :counter_cache => :children_count
|
19
10
|
cms_is_categorized
|
20
11
|
cms_is_mirrored
|
@@ -57,8 +48,8 @@ class Cms::Page < ActiveRecord::Base
|
|
57
48
|
validate :validate_format_of_unescaped_slug
|
58
49
|
|
59
50
|
# -- Scopes ---------------------------------------------------------------
|
60
|
-
default_scope order('cms_pages.position')
|
61
|
-
scope :published, where(:is_published => true)
|
51
|
+
default_scope -> { order('cms_pages.position') }
|
52
|
+
scope :published, -> { where(:is_published => true) }
|
62
53
|
|
63
54
|
# -- Class Methods --------------------------------------------------------
|
64
55
|
# Tree-like structure for pages
|
data/app/models/cms/revision.rb
CHANGED
@@ -6,12 +6,10 @@ class Cms::Revision < ActiveRecord::Base
|
|
6
6
|
|
7
7
|
serialize :data
|
8
8
|
|
9
|
-
attr_accessible :data
|
10
|
-
|
11
9
|
# -- Relationships --------------------------------------------------------
|
12
10
|
belongs_to :record, :polymorphic => true
|
13
11
|
|
14
12
|
# -- Scopes ---------------------------------------------------------------
|
15
|
-
default_scope order('created_at DESC')
|
13
|
+
default_scope -> { order('created_at DESC') }
|
16
14
|
|
17
15
|
end
|
data/app/models/cms/site.rb
CHANGED
@@ -4,13 +4,6 @@ class Cms::Site < ActiveRecord::Base
|
|
4
4
|
|
5
5
|
self.table_name = 'cms_sites'
|
6
6
|
|
7
|
-
attr_accessible :identifier,
|
8
|
-
:label,
|
9
|
-
:hostname,
|
10
|
-
:path,
|
11
|
-
:locale,
|
12
|
-
:is_mirrored
|
13
|
-
|
14
7
|
# -- Relationships --------------------------------------------------------
|
15
8
|
with_options :dependent => :destroy do |site|
|
16
9
|
site.has_many :layouts
|
@@ -31,23 +24,23 @@ class Cms::Site < ActiveRecord::Base
|
|
31
24
|
validates :identifier,
|
32
25
|
:presence => true,
|
33
26
|
:uniqueness => true,
|
34
|
-
:format => { :with =>
|
27
|
+
:format => { :with => /\A\w[a-z0-9_-]*\z/i }
|
35
28
|
validates :label,
|
36
29
|
:presence => true
|
37
30
|
validates :hostname,
|
38
31
|
:presence => true,
|
39
32
|
:uniqueness => { :scope => :path },
|
40
|
-
:format => { :with =>
|
33
|
+
:format => { :with => /\A[\w\.\-]+(?:\:\d+)?\z/ }
|
41
34
|
|
42
35
|
# -- Scopes ---------------------------------------------------------------
|
43
|
-
scope :mirrored, where(:is_mirrored => true)
|
36
|
+
scope :mirrored, -> { where(:is_mirrored => true) }
|
44
37
|
|
45
38
|
# -- Class Methods --------------------------------------------------------
|
46
39
|
# returning the Cms::Site instance based on host and path
|
47
40
|
def self.find_site(host, path = nil)
|
48
41
|
return Cms::Site.first if Cms::Site.count == 1
|
49
42
|
cms_site = nil
|
50
|
-
Cms::Site.
|
43
|
+
Cms::Site.where(:hostname => real_host_from_aliases(host)).each do |site|
|
51
44
|
if site.path.blank?
|
52
45
|
cms_site = site
|
53
46
|
elsif "#{path.to_s.split('?')[0]}/".match /^\/#{Regexp.escape(site.path.to_s)}\//
|
@@ -62,7 +55,7 @@ class Cms::Site < ActiveRecord::Base
|
|
62
55
|
# When removing entire site, let's not destroy content from other sites
|
63
56
|
# Since before_destroy doesn't really work, this does the trick
|
64
57
|
def destroy
|
65
|
-
self.class.
|
58
|
+
self.class.where(:id => self.id).update_all(:is_mirrored => false) if self.is_mirrored?
|
66
59
|
super
|
67
60
|
end
|
68
61
|
|
data/app/models/cms/snippet.rb
CHANGED
@@ -8,11 +8,6 @@ class Cms::Snippet < ActiveRecord::Base
|
|
8
8
|
cms_is_mirrored
|
9
9
|
cms_has_revisions_for :content
|
10
10
|
|
11
|
-
attr_accessible :identifier,
|
12
|
-
:label,
|
13
|
-
:content,
|
14
|
-
:category_ids
|
15
|
-
|
16
11
|
# -- Relationships --------------------------------------------------------
|
17
12
|
belongs_to :site
|
18
13
|
|
@@ -30,10 +25,10 @@ class Cms::Snippet < ActiveRecord::Base
|
|
30
25
|
validates :identifier,
|
31
26
|
:presence => true,
|
32
27
|
:uniqueness => { :scope => :site_id },
|
33
|
-
:format => { :with =>
|
28
|
+
:format => { :with => /\A\w[a-z0-9_-]*\z/i }
|
34
29
|
|
35
30
|
# -- Scopes ---------------------------------------------------------------
|
36
|
-
default_scope order('cms_snippets.position')
|
31
|
+
default_scope -> { order('cms_snippets.position') }
|
37
32
|
|
38
33
|
protected
|
39
34
|
|
@@ -45,7 +40,7 @@ protected
|
|
45
40
|
# gotta reload every single page. Kinda sucks, but might be ok unless there
|
46
41
|
# are hundreds of pages.
|
47
42
|
def clear_cached_page_content
|
48
|
-
site.pages.
|
43
|
+
site.pages.each do |p|
|
49
44
|
Cms::Page.where(:id => p.id).update_all(:content => p.content(true))
|
50
45
|
end
|
51
46
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
%h2= t('.title')
|
4
4
|
|
5
5
|
- content_for :right_column do
|
6
|
-
= render
|
6
|
+
= render 'cms_admin/sites/mirrors', :object => @layout
|
7
7
|
|
8
8
|
= comfy_form_for @layout, :as => :layout, :url => {:action => :update} do |form|
|
9
9
|
= render form
|
@@ -1,5 +1,5 @@
|
|
1
1
|
- namespace = { }
|
2
|
-
- tags = @page.tags(true).select{
|
2
|
+
- tags = @page.tags(true).select{|t| t.is_cms_block?}.uniq{|t| t.identifier}
|
3
3
|
- tags.each do |tag|
|
4
4
|
- namespace[tag.namespace || 'default'] ||= []
|
5
5
|
- namespace[tag.namespace || 'default'] << tag
|
@@ -3,7 +3,7 @@
|
|
3
3
|
%h2= t('.title')
|
4
4
|
|
5
5
|
- content_for :right_column do
|
6
|
-
= render
|
6
|
+
= render 'cms_admin/sites/mirrors', :object => @page
|
7
7
|
|
8
8
|
= comfy_form_for @page, :as => :page, :url => {:action => :update}, :html => {:multipart => true} do |form|
|
9
9
|
= render form
|
@@ -3,7 +3,7 @@
|
|
3
3
|
%h2= t('.title')
|
4
4
|
|
5
5
|
- content_for :right_column do
|
6
|
-
= render
|
6
|
+
= render 'cms_admin/sites/mirrors', :object => @snippet
|
7
7
|
|
8
8
|
= comfy_form_for @snippet, :as => :snippet, :url => {:action => :update} do |form|
|
9
9
|
= render form
|
@@ -9,14 +9,14 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Oleg Khabarov", "The Working Group Inc"]
|
10
10
|
s.email = ["oleg@khabarov.ca"]
|
11
11
|
s.homepage = "http://github.com/comfy/comfortable-mexican-sofa"
|
12
|
-
s.summary = "CMS Engine for Rails
|
12
|
+
s.summary = "CMS Engine for Rails 4 apps"
|
13
13
|
s.description = "ComfortableMexicanSofa is a powerful CMS Engine for Ruby on Rails 3 applications"
|
14
14
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.platform = Gem::Platform::RUBY
|
17
17
|
s.require_paths = ['lib']
|
18
18
|
|
19
|
-
s.add_dependency 'rails', '~>
|
19
|
+
s.add_dependency 'rails', '~> 4.0'
|
20
20
|
s.add_dependency 'formatted_form', '>= 2.1.0'
|
21
21
|
s.add_dependency 'active_link_to', '>= 1.0.0'
|
22
22
|
s.add_dependency 'paperclip', '>= 3.4.0'
|
data/config/application.rb
CHANGED
@@ -2,32 +2,18 @@ require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
8
|
-
# If you want your assets lazily compiled in production, use this line
|
9
|
-
# Bundler.require(:default, :assets, Rails.env)
|
10
|
-
end
|
5
|
+
# Assets should be precompiled for production (so we don't need the gems loaded then)
|
6
|
+
Bundler.require(*Rails.groups(assets: %w(development test)))
|
11
7
|
|
12
8
|
module ComfortableMexicanSofa
|
13
9
|
class Application < Rails::Application
|
14
10
|
|
15
|
-
|
11
|
+
require_relative '../lib/comfortable_mexican_sofa'
|
16
12
|
|
17
13
|
# Settings in config/environments/* take precedence over those specified here.
|
18
14
|
# Application configuration should go into files in config/initializers
|
19
15
|
# -- all .rb files in that directory are automatically loaded.
|
20
16
|
|
21
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
22
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
23
|
-
|
24
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
25
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
26
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
27
|
-
|
28
|
-
# Activate observers that should always be running.
|
29
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
30
|
-
|
31
17
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
32
18
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
33
19
|
# config.time_zone = 'Central Time (US & Canada)'
|
@@ -35,35 +21,8 @@ module ComfortableMexicanSofa
|
|
35
21
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
36
22
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
37
23
|
# config.i18n.default_locale = :de
|
38
|
-
|
39
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
-
config.encoding = "utf-8"
|
41
|
-
|
42
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
-
config.filter_parameters += [:password]
|
44
|
-
|
45
|
-
# Enable escaping HTML in JSON.
|
46
|
-
config.active_support.escape_html_entities_in_json = true
|
47
|
-
|
48
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
49
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
50
|
-
# like if you have constraints or database-specific column types
|
51
|
-
# config.active_record.schema_format = :sql
|
52
|
-
|
53
|
-
# Enforce whitelist mode for mass assignment.
|
54
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
55
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
56
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
57
|
-
config.active_record.whitelist_attributes = true
|
58
|
-
|
59
|
-
# Enable the asset pipeline
|
60
|
-
config.assets.enabled = true
|
61
|
-
|
62
|
-
# Version of your assets, change this if you want to expire all your assets
|
63
|
-
config.assets.version = '1.0'
|
64
|
-
|
65
|
-
config.session_store :cookie_store, :key => '_comfy_session'
|
66
|
-
config.secret_token = 'e0fef4ab56c1cacd8845864fe2cb2a27f5caad72823419f87b2774785187090a654b83229bf9cef70ce475a83bfa561dbbaa2015788181ea837c456964c1e0f6'
|
67
24
|
|
25
|
+
# Making sure we don't load our dev routes as part of the engine
|
26
|
+
config.paths['config/routes.rb'] << 'config/cms_routes.rb'
|
68
27
|
end
|
69
28
|
end
|
data/config/boot.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
1
|
# Set up gems listed in the Gemfile.
|
4
2
|
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
5
3
|
|
6
|
-
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
4
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
5
|
+
File.exists?(ENV['BUNDLE_GEMFILE'])
|
@@ -1,39 +1,27 @@
|
|
1
1
|
defined?(ComfortableMexicanSofa::Application) && ComfortableMexicanSofa::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_controller.perform_caching = false
|
15
15
|
|
16
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
|
-
#
|
23
|
-
config.
|
22
|
+
# Raise an error on page load if there are pending migrations
|
23
|
+
config.active_record.migration_error = :page_load
|
24
24
|
|
25
|
-
|
26
|
-
# Raise exception on mass assignment protection for Active Record models
|
27
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
28
|
-
|
29
|
-
# Log the query plan for queries taking more than this (works
|
30
|
-
# with SQLite, MySQL, and PostgreSQL)
|
31
|
-
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
32
|
-
end
|
33
|
-
|
34
|
-
# Do not compress assets
|
35
|
-
config.assets.compress = false
|
36
|
-
|
37
|
-
# Expands the lines which load the assets
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
38
26
|
config.assets.debug = true
|
39
27
|
end
|
data/config/environments/test.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
defined?(ComfortableMexicanSofa::Application) && ComfortableMexicanSofa::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,33 +7,30 @@ defined?(ComfortableMexicanSofa::Application) && ComfortableMexicanSofa::Applica
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
11
16
|
config.serve_static_assets = true
|
12
17
|
config.static_cache_control = "public, max-age=3600"
|
13
18
|
|
14
|
-
#
|
15
|
-
config.whiny_nils = true
|
16
|
-
|
17
|
-
# Show full error reports and disable caching
|
19
|
+
# Show full error reports and disable caching.
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
20
22
|
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
22
24
|
config.action_dispatch.show_exceptions = false
|
23
25
|
|
24
|
-
# Disable request forgery protection in test environment
|
25
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
26
28
|
|
27
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
28
30
|
# The :test delivery method accumulates sent emails in the
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
|
33
|
-
# Raise exception on mass assignment protection for Active Record models
|
34
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
35
|
-
end
|
36
|
-
|
37
|
-
# Print deprecation notices to the stderr
|
34
|
+
# Print deprecation notices to the stderr.
|
38
35
|
config.active_support.deprecation = :stderr
|
39
36
|
end
|