Skip to content

Commit 23edefc

Browse files
committed
allow <environment>-local.rb to overwrite cache configuration
so that memory_store can be used in development Change-Id: Iaa3badc732b32c0f6970a969b172aa76190e08f7 Reviewed-on: https://gerrit.instructure.com/5882 Reviewed-by: JT Olds <jt@instructure.com> Tested-by: Hudson <hudson@instructure.com>
1 parent 593f369 commit 23edefc

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

config/environments/development.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
Canvas.dynamic_finder_type_cast_error = :raise
2828
end
2929

30-
# eval <env>-local.rb if it exists
31-
Dir[File.dirname(__FILE__) + "/" + File.basename(__FILE__, ".rb") + "-*.rb"].each { |localfile| eval(File.new(localfile).read) }
32-
3330
# initialize cache store
3431
# this needs to happen in each environment config file, rather than a
3532
# config/initializer/* file, to allow Rails' full initialization of the cache
3633
# to take place, including middleware inserts and such.
3734
config.cache_store = Canvas.cache_store_config
3835

36+
# eval <env>-local.rb if it exists
37+
Dir[File.dirname(__FILE__) + "/" + File.basename(__FILE__, ".rb") + "-*.rb"].each { |localfile| eval(File.new(localfile).read) }
38+
3939
# allow debugging only in development environment by default
4040
require "ruby-debug"

config/environments/production.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
# Disable delivery errors, bad email addresses will be ignored
1616
# config.action_mailer.raise_delivery_errors = false
1717

18-
# eval <env>-local.rb if it exists
19-
Dir[File.dirname(__FILE__) + "/" + File.basename(__FILE__, ".rb") + "-*.rb"].each { |localfile| eval(File.new(localfile).read) }
20-
2118
# initialize cache store
2219
# this needs to happen in each environment config file, rather than a
2320
# config/initializer/* file, to allow Rails' full initialization of the cache
2421
# to take place, including middleware inserts and such.
2522
config.cache_store = Canvas.cache_store_config
23+
24+
# eval <env>-local.rb if it exists
25+
Dir[File.dirname(__FILE__) + "/" + File.basename(__FILE__, ".rb") + "-*.rb"].each { |localfile| eval(File.new(localfile).read) }

0 commit comments

Comments
 (0)