Merge branch 'pr-144'
This commit is contained in:
@@ -22,7 +22,7 @@ group :development, :mysql do
|
|||||||
gem 'pry'
|
gem 'pry'
|
||||||
gem 'rack-livereload'
|
gem 'rack-livereload'
|
||||||
gem 'rb-fsevent'
|
gem 'rb-fsevent'
|
||||||
gem 'travis-lint'
|
gem 'travis-lint'
|
||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
end
|
end
|
||||||
|
|||||||
+10
-13
@@ -70,10 +70,10 @@ GEM
|
|||||||
coffee-rails (3.2.2)
|
coffee-rails (3.2.2)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.3.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.7.0)
|
coffee-script-source (1.7.1)
|
||||||
cucumber (1.3.15)
|
cucumber (1.3.15)
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
diff-lcs (>= 1.1.3)
|
diff-lcs (>= 1.1.3)
|
||||||
@@ -127,11 +127,10 @@ GEM
|
|||||||
guard (>= 1.1.0)
|
guard (>= 1.1.0)
|
||||||
haml (4.0.5)
|
haml (4.0.5)
|
||||||
tilt
|
tilt
|
||||||
hashr (0.0.22)
|
|
||||||
highline (1.6.21)
|
highline (1.6.21)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
http_parser.rb (0.6.0)
|
http_parser.rb (0.6.0)
|
||||||
i18n (0.6.9)
|
i18n (0.6.11)
|
||||||
journey (1.0.4)
|
journey (1.0.4)
|
||||||
jquery-fileupload-rails (0.4.1)
|
jquery-fileupload-rails (0.4.1)
|
||||||
actionpack (>= 3.1)
|
actionpack (>= 3.1)
|
||||||
@@ -237,14 +236,13 @@ GEM
|
|||||||
sexp_processor (~> 4.0)
|
sexp_processor (~> 4.0)
|
||||||
ruby_parser (3.5.0)
|
ruby_parser (3.5.0)
|
||||||
sexp_processor (~> 4.1)
|
sexp_processor (~> 4.1)
|
||||||
safe_yaml (0.9.7)
|
sass (3.3.10)
|
||||||
sass (3.3.9)
|
|
||||||
sass-rails (3.2.6)
|
sass-rails (3.2.6)
|
||||||
railties (~> 3.2.0)
|
railties (~> 3.2.0)
|
||||||
sass (>= 3.1.10)
|
sass (>= 3.1.10)
|
||||||
tilt (~> 1.3)
|
tilt (~> 1.3)
|
||||||
sexp_processor (4.4.3)
|
sexp_processor (4.4.3)
|
||||||
simplecov (0.8.2)
|
simplecov (0.9.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
multi_json
|
multi_json
|
||||||
simplecov-html (~> 0.8.0)
|
simplecov-html (~> 0.8.0)
|
||||||
@@ -259,7 +257,7 @@ GEM
|
|||||||
slim (2.0.3)
|
slim (2.0.3)
|
||||||
temple (~> 0.6.6)
|
temple (~> 0.6.6)
|
||||||
tilt (>= 1.3.3, < 2.1)
|
tilt (>= 1.3.3, < 2.1)
|
||||||
slop (3.5.0)
|
slop (3.6.0)
|
||||||
sprockets (2.2.2)
|
sprockets (2.2.2)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
@@ -278,15 +276,14 @@ GEM
|
|||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
timers (1.1.0)
|
timers (1.1.0)
|
||||||
travis-lint (1.8.0)
|
travis-lint (2.0.0)
|
||||||
hashr (~> 0.0.22)
|
json
|
||||||
safe_yaml (~> 0.9.0)
|
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
trollop (2.0)
|
trollop (2.0)
|
||||||
tzinfo (0.3.39)
|
tzinfo (0.3.40)
|
||||||
uglifier (2.5.1)
|
uglifier (2.5.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
unicorn (4.8.3)
|
unicorn (4.8.3)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
before_filter :authenticated, :has_info, :create_analytic
|
before_filter :authenticated, :has_info, :create_analytic, :mailer_options
|
||||||
helper_method :current_user, :is_admin?, :sanitize_font
|
helper_method :current_user, :is_admin?, :sanitize_font
|
||||||
|
|
||||||
# Our security guy keep talking about sea-surfing, cool story bro.
|
# Our security guy keep talking about sea-surfing, cool story bro.
|
||||||
@@ -7,6 +7,11 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def mailer_options
|
||||||
|
ActionMailer::Base.default_url_options[:protocol] = request.protocol
|
||||||
|
ActionMailer::Base.default_url_options[:host] = request.host_with_port
|
||||||
|
end
|
||||||
|
|
||||||
def current_user
|
def current_user
|
||||||
@current_user ||= (
|
@current_user ||= (
|
||||||
User.find_by_auth_token(cookies[:auth_token].to_s) ||
|
User.find_by_auth_token(cookies[:auth_token].to_s) ||
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Railsgoat::Application.configure do
|
|||||||
# Log the query plan for queries taking more than this (works
|
# Log the query plan for queries taking more than this (works
|
||||||
# with SQLite, MySQL, and PostgreSQL)
|
# with SQLite, MySQL, and PostgreSQL)
|
||||||
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||||
|
|
||||||
# Tired of caching causing issues
|
# Tired of caching causing issues
|
||||||
config.middleware.delete Rack::ETag
|
config.middleware.delete Rack::ETag
|
||||||
|
|
||||||
@@ -41,7 +41,6 @@ Railsgoat::Application.configure do
|
|||||||
# ActionMailer settings for email support
|
# ActionMailer settings for email support
|
||||||
config.action_mailer.delivery_method = :smtp
|
config.action_mailer.delivery_method = :smtp
|
||||||
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
||||||
config.action_mailer.default_url_options = { :host => "localhost:3000" }
|
|
||||||
|
|
||||||
config.middleware.insert_before(
|
config.middleware.insert_before(
|
||||||
Rack::Lock, Rack::LiveReload,
|
Rack::Lock, Rack::LiveReload,
|
||||||
|
|||||||
Reference in New Issue
Block a user