From 40a88b5b09eede0c4c985d9e1fb02f28deedbe1d Mon Sep 17 00:00:00 2001 From: Taylor Griffin Date: Sat, 15 Nov 2014 21:44:55 +1100 Subject: [PATCH] tests run but fail like whoa --- Gemfile | 58 ++++---- Gemfile.lock | 230 +++++++++++++++-------------- app/models/comment.rb | 2 +- app/models/crop.rb | 6 +- app/models/garden.rb | 4 +- app/models/harvest.rb | 2 +- app/models/member.rb | 4 +- app/models/notification.rb | 2 +- app/models/order.rb | 2 +- app/models/photo.rb | 2 +- app/models/plant_part.rb | 2 +- app/models/planting.rb | 4 +- app/models/post.rb | 2 +- app/models/seed.rb | 2 +- config/environments/development.rb | 6 +- config/environments/production.rb | 6 +- config/environments/staging.rb | 6 +- config/environments/test.rb | 2 + config/routes.rb | 54 +++---- 19 files changed, 207 insertions(+), 189 deletions(-) diff --git a/Gemfile b/Gemfile index d034f2789..725100ff2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,11 +2,23 @@ source 'https://rubygems.org' ruby "2.1.2" +# gems for Rails 4 upgrade +gem 'rails4_upgrade' +gem 'actionpack-action_caching', '~>1.0.0' +gem 'actionpack-page_caching', '~>1.0.0' +gem 'actionpack-xml_parser', '~>1.0.0' +gem 'actionview-encoded_mail_to', '~>1.0.4' +gem 'activerecord-session_store', '~>0.0.1' +gem 'activeresource', '~>4.0.0.beta1' +gem 'protected_attributes', '~>1.0.1' +gem 'rails-observers', '~>0.1.1' +gem 'rails-perftest', '~>0.0.2' + gem 'bundler', '>=1.1.5' -gem 'rails', '3.2.13' -gem 'rack', '~>1.4.5' -gem 'json', '~>1.7.7' +gem 'rails', '4.1.7' +# gem 'rack', '~>1.4.5' +# gem 'json', '~>1.7.7' gem 'haml' gem 'leaflet-rails' gem 'leaflet-markercluster-rails' @@ -37,32 +49,28 @@ group :production, :staging do gem 'rails_12factor' # supresses heroku plugin injection end -# Gems used only for assets and not required -# in production environments by default. -group :assets do - # CSS preprocessor, used for app/assets/stylesheets/application.css - gem 'sass-rails', '~> 3.2.3' - # CoffeeScript is a Python-like language that compiles to JavaScript - gem 'coffee-rails', '~> 3.2.1' +# CSS preprocessor, used for app/assets/stylesheets/application.css +gem 'sass-rails', '~> 4.0.4' +# CoffeeScript is a Python-like language that compiles to JavaScript +gem 'coffee-rails', '~> 4.1.0' - # less-rails depends on a JavaScript engine; we use therubyracer. - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - # long term, we'll probably want node.js for performance, but this will do - # for now as it's easier for new people to install - gem "therubyracer", "~> 0.12", :platforms => :ruby - # libv8 is needed by therubyracer and is a bit finicky - gem 'libv8', '3.16.14.3' +# less-rails depends on a JavaScript engine; we use therubyracer. +# See https://github.com/sstephenson/execjs#readme for more supported runtimes +# long term, we'll probably want node.js for performance, but this will do +# for now as it's easier for new people to install +gem "therubyracer", "~> 0.12", :platforms => :ruby +# libv8 is needed by therubyracer and is a bit finicky +gem 'libv8', '3.16.14.3' - # Another CSS preprocessor, used for Bootstrap overrides - gem "less", '~>2.5.0' - gem "less-rails", '~> 2.5.0' - # CSS framework - gem "less-rails-bootstrap", '~> 3.2.0' +# Another CSS preprocessor, used for Bootstrap overrides +gem "less", '~>2.5.0' +gem "less-rails", '~> 2.5.0' +# CSS framework +gem "less-rails-bootstrap", '~> 3.2.0' - gem 'uglifier', '>= 1.0.3' # JavaScript compressor +gem 'uglifier', '~> 2.5.3' # JavaScript compressor - gem 'compass-rails', '~> 1.0.3' # Yet Another CSS framework -end +# gem 'compass-rails', '~> 1.0.3' # Yet Another CSS framework gem 'jquery-rails' gem 'jquery-ui-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 34b5f136a..3a3c2ddda 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -20,36 +20,51 @@ PATH GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) + actionmailer (4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) + mail (~> 2.5, >= 2.5.4) + actionpack (4.1.7) + actionview (= 4.1.7) + activesupport (= 4.1.7) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + actionpack-action_caching (1.0.0) + actionpack (>= 4.0.0.beta, < 5.0) + actionpack-page_caching (1.0.2) + actionpack (>= 4.0.0, < 5) + actionpack-xml_parser (1.0.1) + actionpack (>= 4.0.0.rc1) + actionview (4.1.7) + activesupport (= 4.1.7) + builder (~> 3.1) erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) + actionview-encoded_mail_to (1.0.5) + rails + activemodel (4.1.7) + activesupport (= 4.1.7) + builder (~> 3.1) + activerecord (4.1.7) + activemodel (= 4.1.7) + activesupport (= 4.1.7) + arel (~> 5.0.0) + activerecord-session_store (0.0.1) + actionpack (>= 4.0.0.beta, < 5) + activerecord (>= 4.0.0.beta, < 5) + railties (>= 4.0.0.beta, < 5) + activeresource (4.0.0.beta1) + activemodel (>= 4.0.0.beta1) + activesupport (>= 4.0.0.beta1) + rails-observers (~> 0.1.1) + activesupport (4.1.7) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) addressable (2.3.6) - arel (3.0.3) - bcrypt (3.1.7) + arel (5.0.1.20140414130214) + bcrypt (3.1.9) better_errors (2.0.0) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -59,7 +74,7 @@ GEM bluecloth (2.2.0) bootstrap-datepicker-rails (1.3.0.2) railties (>= 3.0) - builder (3.0.4) + builder (3.2.2) cancan (1.6.10) capybara (2.4.4) mime-types (>= 1.16) @@ -70,30 +85,23 @@ GEM capybara-email (2.4.0) capybara (~> 2.4) mail - chunky_png (1.3.2) cliver (0.3.2) coderay (1.1.0) - coffee-rails (3.2.2) + coffee-rails (4.1.0) coffee-script (>= 2.2.0) - railties (~> 3.2.0) + railties (>= 4.0.0, < 5.0) coffee-script (2.3.0) coffee-script-source execjs coffee-script-source (1.8.0) commonjs (0.2.7) - compass (0.12.7) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.2.19) - compass-rails (1.0.3) - compass (>= 0.12.2, < 0.14) coveralls (0.7.1) multi_json (~> 1.3) rest-client simplecov (>= 0.7) term-ansicolor thor - csv_shaper (1.0.0) + csv_shaper (1.1.1) activesupport (>= 3.0.0) dalli (2.7.2) database_cleaner (1.3.0) @@ -120,10 +128,8 @@ GEM figaro (1.0.0) thor (~> 0.14) flickraw (0.9.8) - friendly_id (4.0.10.1) - activerecord (>= 3.0, < 4.0) - fssm (0.2.10) - gibbon (1.1.3) + friendly_id (4.0.10) + gibbon (1.1.4) httparty multi_json (>= 1.3.4) gravatar-ultimate (2.0.0) @@ -131,19 +137,19 @@ GEM rack haml (4.0.5) tilt - haml-rails (0.4) - actionpack (>= 3.1, < 4.1) - activesupport (>= 3.1, < 4.1) - haml (>= 3.1, < 4.1) - railties (>= 3.1, < 4.1) + haml-rails (0.5.3) + actionpack (>= 4.0.1) + activesupport (>= 4.0.1) + haml (>= 3.1, < 5.0) + railties (>= 4.0.1) hashie (3.3.1) highline (1.6.21) hike (1.2.3) - httparty (0.11.0) - multi_json (~> 1.0) + httparty (0.13.3) + json (~> 1.8) multi_xml (>= 0.5.2) - i18n (0.6.1) - i18n-tasks (0.7.7) + i18n (0.6.11) + i18n-tasks (0.7.8) activesupport easy_translate (>= 0.5.0) erubis @@ -152,18 +158,17 @@ GEM slop (>= 3.5.0) term-ansicolor terminal-table - journey (1.0.4) jquery-rails (3.1.2) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (4.1.2) - railties (>= 3.1.0) + jquery-ui-rails (5.0.2) + railties (>= 3.2.16) js-routes (0.9.9) railties (>= 3.2) sprockets-rails - json (1.7.7) + json (1.8.1) kgio (2.9.2) - launchy (2.4.2) + launchy (2.4.3) addressable (~> 2.3) leaflet-markercluster-rails (0.7.0) railties (>= 3.1) @@ -178,19 +183,19 @@ GEM letter_opener (1.2.0) launchy (~> 2.2) libv8 (3.16.14.3) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) + mail (2.6.3) + mime-types (>= 1.16, < 3) memcachier (0.0.2) method_source (0.8.2) - mime-types (1.25.1) - mini_portile (0.6.0) + mime-types (2.4.3) + mini_portile (0.6.1) + minitest (5.4.3) multi_json (1.10.1) multi_xml (0.5.5) netrc (0.8.0) - newrelic_rpm (3.9.5.251) - nokogiri (1.6.3.1) - mini_portile (= 0.6.0) + newrelic_rpm (3.9.6.257) + nokogiri (1.6.4.1) + mini_portile (~> 0.6.0) oauth (0.4.7) omniauth (1.2.2) hashie (>= 1.2, < 4) @@ -210,42 +215,43 @@ GEM cliver (~> 0.3.1) multi_json (~> 1.0) websocket-driver (>= 0.2.0) - polyglot (0.3.5) + protected_attributes (1.0.8) + activemodel (>= 4.0.1, < 5.0) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.4) - rack + rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) - bundler (~> 1.0) - railties (= 3.2.13) + rails (4.1.7) + actionmailer (= 4.1.7) + actionpack (= 4.1.7) + actionview (= 4.1.7) + activemodel (= 4.1.7) + activerecord (= 4.1.7) + activesupport (= 4.1.7) + bundler (>= 1.3.0, < 2.0) + railties (= 4.1.7) + sprockets-rails (~> 2.0) + rails-observers (0.1.2) + activemodel (~> 4.0) + rails-perftest (0.0.5) + rails4_upgrade (0.5.0) + bundler (>= 1.2.2) + terminal-table (>= 1.4.5) rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.2) rails_stdout_logging (0.0.3) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) + railties (4.1.7) + actionpack (= 4.1.7) + activesupport (= 4.1.7) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) + thor (>= 0.18.1, < 2.0) raindrops (0.13.0) rake (10.3.2) - rdoc (3.12.2) - json (~> 1.4) ref (1.0.5) rest-client (1.7.2) mime-types (>= 1.16, < 3.0) @@ -262,23 +268,26 @@ GEM rspec-expectations (~> 2.12.0) rspec-mocks (~> 2.12.0) sass (3.2.19) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) + sass-rails (4.0.4) + railties (>= 4.0.0, < 5.0) + sass (~> 3.2.2) + sprockets (~> 2.8, < 2.12) + sprockets-rails (~> 2.0) simplecov (0.9.1) docile (~> 1.1.0) multi_json (~> 1.0) simplecov-html (~> 0.8.0) simplecov-html (0.8.0) slop (3.6.0) - sprockets (2.2.2) + sprockets (2.11.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (0.0.1) - sprockets (>= 1.0.2) + sprockets-rails (2.2.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (>= 2.8, < 4.0) term-ansicolor (1.3.0) tins (~> 1.0) terminal-table (1.4.5) @@ -290,13 +299,11 @@ GEM 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) - uglifier (2.2.1) + tzinfo (1.2.2) + thread_safe (~> 0.1) + uglifier (2.5.3) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) unicorn (4.8.3) kgio (~> 2.6) rack @@ -307,7 +314,7 @@ GEM nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) - websocket-driver (0.3.5) + websocket-driver (0.4.0) will_paginate (3.0.7) xpath (2.0.0) nokogiri (~> 1.3) @@ -316,8 +323,14 @@ PLATFORMS ruby DEPENDENCIES + actionpack-action_caching (~> 1.0.0) + actionpack-page_caching (~> 1.0.0) + actionpack-xml_parser (~> 1.0.0) + actionview-encoded_mail_to (~> 1.0.4) active_utils (= 1.0.5)! activemerchant (= 1.33.0)! + activerecord-session_store (~> 0.0.1) + activeresource (~> 4.0.0.beta1) better_errors binding_of_caller bluecloth @@ -326,8 +339,7 @@ DEPENDENCIES cancan capybara capybara-email - coffee-rails (~> 3.2.1) - compass-rails (~> 1.0.3) + coffee-rails (~> 4.1.0) coveralls csv_shaper dalli @@ -346,7 +358,6 @@ DEPENDENCIES jquery-rails jquery-ui-rails js-routes - json (~> 1.7.7) leaflet-markercluster-rails leaflet-rails less (~> 2.5.0) @@ -361,15 +372,18 @@ DEPENDENCIES omniauth-twitter pg poltergeist (~> 1.5.1) + protected_attributes (~> 1.0.1) pry - rack (~> 1.4.5) - rails (= 3.2.13) + rails (= 4.1.7) + rails-observers (~> 0.1.1) + rails-perftest (~> 0.0.2) + rails4_upgrade rails_12factor rake (>= 10.0.0) rspec-rails (~> 2.12.1) - sass-rails (~> 3.2.3) + sass-rails (~> 4.0.4) therubyracer (~> 0.12) - uglifier (>= 1.0.3) + uglifier (~> 2.5.3) unicorn webrat will_paginate (~> 3.0) diff --git a/app/models/comment.rb b/app/models/comment.rb index f797848e0..91d163f98 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -3,7 +3,7 @@ class Comment < ActiveRecord::Base belongs_to :author, :class_name => 'Member' belongs_to :post - default_scope order("created_at DESC") + default_scope { order("created_at DESC") } scope :post_order, reorder("created_at ASC") # for display on post page after_create do diff --git a/app/models/crop.rb b/app/models/crop.rb index 9777d8fd4..c8025a270 100644 --- a/app/models/crop.rb +++ b/app/models/crop.rb @@ -13,7 +13,7 @@ class Crop < ActiveRecord::Base has_many :photos, :through => :plantings has_many :seeds has_many :harvests - has_many :plant_parts, :through => :harvests, :uniq => :true + has_many :plant_parts, -> { uniq }, :through => :harvests belongs_to :creator, :class_name => 'Member' belongs_to :parent, :class_name => 'Crop' @@ -22,7 +22,7 @@ class Crop < ActiveRecord::Base before_destroy {|crop| crop.posts.clear} - default_scope order("lower(name) asc") + default_scope { order("lower(name) asc") } scope :recent, reorder("created_at desc") scope :toplevel, where(:parent_id => nil) scope :popular, reorder("plantings_count desc, lower(name) asc") @@ -30,7 +30,7 @@ class Crop < ActiveRecord::Base validates :en_wikipedia_url, :format => { - :with => /^https?:\/\/en\.wikipedia\.org\/wiki/, + :with => /\Ahttps?:\/\/en\.wikipedia\.org\/wiki/, :message => 'is not a valid English Wikipedia URL' } diff --git a/app/models/garden.rb b/app/models/garden.rb index 7f64994cc..cc5492906 100644 --- a/app/models/garden.rb +++ b/app/models/garden.rb @@ -7,7 +7,7 @@ class Garden < ActiveRecord::Base :location, :latitude, :longitude, :area, :area_unit belongs_to :owner, :class_name => 'Member', :foreign_key => 'owner_id' - has_many :plantings, :order => 'created_at DESC', :dependent => :destroy + has_many :plantings, -> { order(created_at: :desc) }, :dependent => :destroy has_many :crops, :through => :plantings # set up geocoding @@ -16,7 +16,7 @@ class Garden < ActiveRecord::Base after_validation :empty_unwanted_geocodes after_save :mark_inactive_garden_plantings_as_finished - default_scope order("lower(name) asc") + default_scope { order("lower(name) asc") } scope :active, where(:active => true) scope :inactive, where(:active => false) diff --git a/app/models/harvest.rb b/app/models/harvest.rb index 48e9eac19..184ae595d 100644 --- a/app/models/harvest.rb +++ b/app/models/harvest.rb @@ -21,7 +21,7 @@ class Harvest < ActiveRecord::Base end end - default_scope order('created_at DESC') + default_scope { order('created_at DESC') } validates :crop, :presence => {:message => "must be present and exist in our database"} diff --git a/app/models/member.rb b/app/models/member.rb index 14d16c175..d75b39001 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -27,7 +27,7 @@ class Member < ActiveRecord::Base has_many :photos - default_scope order("lower(login_name) asc") + default_scope { order("lower(login_name) asc") } scope :confirmed, where('confirmed_at IS NOT NULL') scope :located, where("location <> '' and latitude IS NOT NULL and longitude IS NOT NULL") scope :recently_signed_in, reorder('updated_at DESC') @@ -74,7 +74,7 @@ class Member < ActiveRecord::Base :message => "name is reserved" }, :format => { - :with => /^\w+$/, + :with => /\A\w+\z/, :message => "may only include letters, numbers, or underscores" }, :uniqueness => { diff --git a/app/models/notification.rb b/app/models/notification.rb index 3fc48a0c7..9ab2d183b 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -6,7 +6,7 @@ class Notification < ActiveRecord::Base belongs_to :recipient, :class_name => 'Member' belongs_to :post - default_scope order('created_at DESC') + default_scope { order('created_at DESC') } scope :unread, where(:read => false) before_create :replace_blank_subject diff --git a/app/models/order.rb b/app/models/order.rb index 122d83700..68fcd80ac 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -4,7 +4,7 @@ class Order < ActiveRecord::Base has_many :order_items, :dependent => :destroy - default_scope order('created_at DESC') + default_scope { order('created_at DESC') } validates :referral_code, :format => { :with => /\A[a-zA-Z0-9 ]*\z/, diff --git a/app/models/photo.rb b/app/models/photo.rb index 862b9d28b..995fecc71 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -10,7 +10,7 @@ class Photo < ActiveRecord::Base photo.harvests.clear end - default_scope order("created_at desc") + default_scope { order("created_at desc") } # remove photos that aren't used by anything def destroy_if_unused diff --git a/app/models/plant_part.rb b/app/models/plant_part.rb index 41e8d26ea..16241372a 100644 --- a/app/models/plant_part.rb +++ b/app/models/plant_part.rb @@ -3,7 +3,7 @@ class PlantPart < ActiveRecord::Base friendly_id :name, :use => :slugged has_many :harvests - has_many :crops, :through => :harvests, :uniq => true + has_many :crops, -> { uniq }, :through => :harvests attr_accessible :name, :slug diff --git a/app/models/planting.rb b/app/models/planting.rb index 889fb2d80..132bed8ed 100644 --- a/app/models/planting.rb +++ b/app/models/planting.rb @@ -21,7 +21,7 @@ class Planting < ActiveRecord::Base end end - default_scope order("created_at desc") + default_scope { order("created_at desc") } scope :finished, where(:finished => true) scope :current, where(:finished => false) @@ -32,7 +32,7 @@ class Planting < ActiveRecord::Base :to => :crop, :prefix => true - default_scope order("created_at desc") + default_scope { order("created_at desc") } validates :crop_id, :presence => {:message => "must be present and exist in our database"} diff --git a/app/models/post.rb b/app/models/post.rb index 7f72a4e57..05d95e056 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -11,7 +11,7 @@ class Post < ActiveRecord::Base # also has_many notifications, but kinda meaningless to get at them # from this direction, so we won't set up an association for now. - default_scope order("created_at desc") + default_scope { order("created_at desc") } validates :subject, :format => { diff --git a/app/models/seed.rb b/app/models/seed.rb index 38cd3b714..94cccddcb 100644 --- a/app/models/seed.rb +++ b/app/models/seed.rb @@ -8,7 +8,7 @@ class Seed < ActiveRecord::Base belongs_to :crop belongs_to :owner, :class_name => 'Member', :foreign_key => 'owner_id' - default_scope order("created_at desc") + default_scope { order("created_at desc") } validates :crop, :presence => {:message => "must be present and exist in our database"} validates :quantity, diff --git a/config/environments/development.rb b/config/environments/development.rb index 7b25f588c..890d210a7 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,6 +1,8 @@ Growstuff::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false + # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. @@ -28,10 +30,6 @@ Growstuff::Application.configure do # Raise exception on mass assignment protection for Active Record models config.active_record.mass_assignment_sanitizer = :strict - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 - # Do not compress assets config.assets.compress = false diff --git a/config/environments/production.rb b/config/environments/production.rb index a5b131a4b..e2b6d5735 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,6 +1,8 @@ Growstuff::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = true + # Code is not reloaded between requests config.cache_classes = true @@ -61,10 +63,6 @@ Growstuff::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - # config.active_record.auto_explain_threshold_in_seconds = 0.5 - # Growstuff configuration config.new_crops_request_link = "http://growstuff.org/posts/skud-20130319-requests-for-new-crops" config.action_mailer.default_url_options = { :host => 'growstuff.org' } diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 3c9e83e98..fda2929ef 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -1,6 +1,8 @@ Growstuff::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = true + # Code is not reloaded between requests config.cache_classes = true @@ -61,10 +63,6 @@ Growstuff::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - # config.active_record.auto_explain_threshold_in_seconds = 0.5 - # Growstuff configuration config.new_crops_request_link = "http://example.com/not-a-real-url" config.action_mailer.default_url_options = { :host => 'dev.growstuff.org' } diff --git a/config/environments/test.rb b/config/environments/test.rb index 6fb8cad3e..237e4bef4 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,6 +1,8 @@ Growstuff::Application.configure do # Settings specified here will take precedence over those in config/application.rb + config.eager_load = false + # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped diff --git a/config/routes.rb b/config/routes.rb index d751647d5..0bc238e7e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,29 +11,29 @@ Growstuff::Application.routes.draw do resources :authentications resources :plantings - match '/plantings/owner/:owner' => 'plantings#index', :as => 'plantings_by_owner' - match '/plantings/crop/:crop' => 'plantings#index', :as => 'plantings_by_crop' + get '/plantings/owner/:owner' => 'plantings#index', :as => 'plantings_by_owner' + get '/plantings/crop/:crop' => 'plantings#index', :as => 'plantings_by_crop' resources :gardens - match '/gardens/owner/:owner' => 'gardens#index', :as => 'gardens_by_owner' + get '/gardens/owner/:owner' => 'gardens#index', :as => 'gardens_by_owner' resources :seeds - match '/seeds/owner/:owner' => 'seeds#index', :as => 'seeds_by_owner' - match '/seeds/crop/:crop' => 'seeds#index', :as => 'seeds_by_crop' + get '/seeds/owner/:owner' => 'seeds#index', :as => 'seeds_by_owner' + get '/seeds/crop/:crop' => 'seeds#index', :as => 'seeds_by_crop' resources :harvests - match '/harvests/owner/:owner' => 'harvests#index', :as => 'harvests_by_owner' - match '/harvests/crop/:crop' => 'harvests#index', :as => 'harvests_by_crop' + get '/harvests/owner/:owner' => 'harvests#index', :as => 'harvests_by_owner' + get '/harvests/crop/:crop' => 'harvests#index', :as => 'harvests_by_crop' resources :posts - match '/posts/author/:author' => 'posts#index', :as => 'posts_by_author' + get '/posts/author/:author' => 'posts#index', :as => 'posts_by_author' resources :scientific_names resources :alternate_names - match 'crops/wrangle' => 'crops#wrangle', :as => 'wrangle_crops' - match 'crops/hierarchy' => 'crops#hierarchy', :as => 'crops_hierarchy' - match 'crops/search' => 'crops#search', :as => 'crops_search' + get 'crops/wrangle' => 'crops#wrangle', :as => 'wrangle_crops' + get 'crops/hierarchy' => 'crops#hierarchy', :as => 'crops_hierarchy' + get 'crops/search' => 'crops#search', :as => 'crops_search' resources :crops resources :comments @@ -49,9 +49,9 @@ Growstuff::Application.routes.draw do resources :account_types resources :accounts resources :orders - match 'orders/:id/checkout' => 'orders#checkout', :as => 'checkout_order' - match 'orders/:id/complete' => 'orders#complete', :as => 'complete_order' - match 'orders/:id/cancel' => 'orders#cancel', :as => 'cancel_order' + get 'orders/:id/checkout' => 'orders#checkout', :as => 'checkout_order' + get 'orders/:id/complete' => 'orders#complete', :as => 'complete_order' + get 'orders/:id/cancel' => 'orders#cancel', :as => 'cancel_order' resources :order_items resources :products @@ -59,24 +59,24 @@ Growstuff::Application.routes.draw do get "home/index" root :to => 'home#index' - match 'auth/:provider/callback' => 'authentications#create' + post 'auth/:provider/callback' => 'authentications#create' - match '/policy/:action' => 'policy#:action' + get '/policy/:action' => 'policy#:action' - match '/support' => 'support#index' - match '/support/:action' => 'support#:action' + get '/support' => 'support#index' + get '/support/:action' => 'support#:action' - match '/about' => 'about#index' - match '/about/:action' => 'about#:action' + get '/about' => 'about#index' + get '/about/:action' => 'about#:action' - match '/shop' => 'shop#index' - match '/shop/:action' => 'shop#:action' + get '/shop' => 'shop#index' + get '/shop/:action' => 'shop#:action' - match '/admin/orders' => 'admin/orders#index' - match '/admin/orders/:action' => 'admin/orders#:action' - match '/admin' => 'admin#index' - match '/admin/newsletter' => 'admin#newsletter', :as => :admin_newsletter - match '/admin/:action' => 'admin#:action' + get '/admin/orders' => 'admin/orders#index' + get '/admin/orders/:action' => 'admin/orders#:action' + get '/admin' => 'admin#index' + get '/admin/newsletter' => 'admin#newsletter', :as => :admin_newsletter + get '/admin/:action' => 'admin#:action' end