removes beta testers functionality
This commit is contained in:
@@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
|
|||||||
include HasOrders
|
include HasOrders
|
||||||
|
|
||||||
before_action :authenticate_http_basic, if: :http_basic_auth_site?
|
before_action :authenticate_http_basic, if: :http_basic_auth_site?
|
||||||
before_action :authenticate_user!, unless: :devise_controller?, if: :beta_site?
|
|
||||||
before_action :authenticate_beta_tester!, unless: :devise_controller?, if: :beta_site?
|
|
||||||
|
|
||||||
before_action :ensure_signup_complete
|
before_action :ensure_signup_complete
|
||||||
before_action :set_locale
|
before_action :set_locale
|
||||||
@@ -33,21 +31,6 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def authenticate_beta_tester!
|
|
||||||
unless signed_in? && beta_testers.include?(current_user.email)
|
|
||||||
sign_out(current_user)
|
|
||||||
redirect_to new_user_session_path, alert: t('application.alert.only_beta_testers')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def beta_testers
|
|
||||||
File.readlines('config/beta-testers.txt').map {|email| email.strip }
|
|
||||||
end
|
|
||||||
|
|
||||||
def beta_site?
|
|
||||||
Rails.application.secrets.beta_site
|
|
||||||
end
|
|
||||||
|
|
||||||
def http_basic_auth_site?
|
def http_basic_auth_site?
|
||||||
Rails.application.secrets.http_basic_auth
|
Rails.application.secrets.http_basic_auth
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ namespace :deploy do
|
|||||||
# Custom compile and rsync of assets - works, but it is very slow
|
# Custom compile and rsync of assets - works, but it is very slow
|
||||||
#after 'deploy:symlink:shared', 'deploy:compile_assets_locally'
|
#after 'deploy:symlink:shared', 'deploy:compile_assets_locally'
|
||||||
|
|
||||||
after :finishing, 'deploy:beta_testers'
|
|
||||||
after :finishing, 'deploy:cleanup'
|
after :finishing, 'deploy:cleanup'
|
||||||
# Restart unicorn
|
# Restart unicorn
|
||||||
after 'deploy:publishing', 'deploy:restart'
|
after 'deploy:publishing', 'deploy:restart'
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ en:
|
|||||||
verification::sms: "Telephone"
|
verification::sms: "Telephone"
|
||||||
verification::letter: "the verification"
|
verification::letter: "the verification"
|
||||||
application:
|
application:
|
||||||
alert:
|
|
||||||
only_beta_testers: "Sorry: only beta testers have access at this time"
|
|
||||||
close: "Close"
|
close: "Close"
|
||||||
menu: "Menu"
|
menu: "Menu"
|
||||||
debates:
|
debates:
|
||||||
|
|||||||
@@ -73,8 +73,6 @@ es:
|
|||||||
verification::sms: "el teléfono"
|
verification::sms: "el teléfono"
|
||||||
verification::letter: "la verificación"
|
verification::letter: "la verificación"
|
||||||
application:
|
application:
|
||||||
alert:
|
|
||||||
only_beta_testers: "Lo sentimos sólo los usuarios de pruebas tienen acceso de momento"
|
|
||||||
close: "Cerrar"
|
close: "Cerrar"
|
||||||
menu: "Menú"
|
menu: "Menú"
|
||||||
debates:
|
debates:
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20151021113348) do
|
ActiveRecord::Schema.define(version: 20151021113348) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
enable_extension "unaccent"
|
|
||||||
|
|
||||||
create_table "activities", force: :cascade do |t|
|
create_table "activities", force: :cascade do |t|
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
@@ -92,10 +92,10 @@ ActiveRecord::Schema.define(version: 20151021113348) do
|
|||||||
t.string "visit_id"
|
t.string "visit_id"
|
||||||
t.datetime "hidden_at"
|
t.datetime "hidden_at"
|
||||||
t.integer "flags_count", default: 0
|
t.integer "flags_count", default: 0
|
||||||
|
t.datetime "ignored_flag_at"
|
||||||
t.integer "cached_votes_total", default: 0
|
t.integer "cached_votes_total", default: 0
|
||||||
t.integer "cached_votes_up", default: 0
|
t.integer "cached_votes_up", default: 0
|
||||||
t.integer "cached_votes_down", default: 0
|
t.integer "cached_votes_down", default: 0
|
||||||
t.datetime "ignored_flag_at"
|
|
||||||
t.integer "comments_count", default: 0
|
t.integer "comments_count", default: 0
|
||||||
t.datetime "confirmed_hide_at"
|
t.datetime "confirmed_hide_at"
|
||||||
t.integer "cached_anonymous_votes_total", default: 0
|
t.integer "cached_anonymous_votes_total", default: 0
|
||||||
@@ -111,7 +111,6 @@ ActiveRecord::Schema.define(version: 20151021113348) do
|
|||||||
add_index "debates", ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree
|
add_index "debates", ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree
|
||||||
add_index "debates", ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree
|
add_index "debates", ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree
|
||||||
add_index "debates", ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree
|
add_index "debates", ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree
|
||||||
add_index "debates", ["description"], name: "index_debates_on_description", using: :btree
|
|
||||||
add_index "debates", ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree
|
add_index "debates", ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree
|
||||||
add_index "debates", ["hot_score"], name: "index_debates_on_hot_score", using: :btree
|
add_index "debates", ["hot_score"], name: "index_debates_on_hot_score", using: :btree
|
||||||
add_index "debates", ["title"], name: "index_debates_on_title", using: :btree
|
add_index "debates", ["title"], name: "index_debates_on_title", using: :btree
|
||||||
@@ -217,7 +216,6 @@ ActiveRecord::Schema.define(version: 20151021113348) do
|
|||||||
add_index "proposals", ["author_id"], name: "index_proposals_on_author_id", using: :btree
|
add_index "proposals", ["author_id"], name: "index_proposals_on_author_id", using: :btree
|
||||||
add_index "proposals", ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree
|
add_index "proposals", ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree
|
||||||
add_index "proposals", ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree
|
add_index "proposals", ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree
|
||||||
add_index "proposals", ["description"], name: "index_proposals_on_description", using: :btree
|
|
||||||
add_index "proposals", ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree
|
add_index "proposals", ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree
|
||||||
add_index "proposals", ["hot_score"], name: "index_proposals_on_hot_score", using: :btree
|
add_index "proposals", ["hot_score"], name: "index_proposals_on_hot_score", using: :btree
|
||||||
add_index "proposals", ["question"], name: "index_proposals_on_question", using: :btree
|
add_index "proposals", ["question"], name: "index_proposals_on_question", using: :btree
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace :deploy do
|
|
||||||
desc "compiles assets locally then rsyncs"
|
|
||||||
task :beta_testers do
|
|
||||||
on roles(:app) do |role|
|
|
||||||
run_locally do
|
|
||||||
execute"rsync -av ./config/beta-testers.txt #{role.user}@#{role.hostname}:#{shared_path}/config/beta-testers.txt;"
|
|
||||||
end
|
|
||||||
"chmod -R 755 #{shared_path}/config/beta-testers.txt"
|
|
||||||
execute "ln -nfs #{shared_path}/config/beta-testers.txt #{current_path}/config/beta-testers.txt"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user