diff --git a/Gemfile b/Gemfile index 18bc3a0..bcd2a48 100644 --- a/Gemfile +++ b/Gemfile @@ -8,8 +8,6 @@ gem 'starter_generators' gem 'kaminari' -# Use sqlite3 as the database for Active Record -gem 'sqlite3' # Use SCSS for stylesheets gem 'sass-rails', '~> 4.0.0' @@ -48,3 +46,13 @@ gem 'bcrypt-ruby', '~> 3.0.0' # Use debugger # gem 'debugger', group: [:development, :test] + +group :production do + gem 'pg' + gem 'rails_12factor' +end + +group :development do + # Use sqlite3 as the database for Active Record + gem 'sqlite3' +end diff --git a/Gemfile.lock b/Gemfile.lock index c64c484..8800279 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,6 +57,7 @@ GEM mime-types (1.23) minitest (4.7.5) multi_json (1.7.7) + pg (0.16.0) polyglot (0.3.3) rack (1.5.2) rack-test (0.6.2) @@ -69,6 +70,11 @@ GEM bundler (>= 1.3.0, < 2.0) railties (= 4.0.0) sprockets-rails (~> 2.0.0) + rails_12factor (0.0.2) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.1) + rails_stdout_logging (0.0.1) railties (4.0.0) actionpack (= 4.0.0) activesupport (= 4.0.0) @@ -119,7 +125,9 @@ DEPENDENCIES jbuilder (~> 1.2) jquery-rails kaminari + pg rails (= 4.0.0) + rails_12factor sass-rails (~> 4.0.0) sdoc sqlite3 diff --git a/README.rdoc b/README.rdoc index dd4e97e..6d389d4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,4 +1,5 @@ == README +Vince has arrived This README would normally document whatever steps are necessary to get the application up and running. diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d9cbdf2..f031eab 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,4 +8,14 @@ def current_user end helper_method :current_user + before_filter :authenticate + + def authenticate + if Rails.env.staging? + authenticate_or_request_with_http_basic do |username, password| + username == ENV["HTTP_USERNAME"] && password == ENV["HTTP_PASSWORD"] + end + end + end + end