diff --git a/Pearlception/app/controllers/application_controller.rb b/Pearlception/app/controllers/application_controller.rb index e32a2a1..17ec44e 100644 --- a/Pearlception/app/controllers/application_controller.rb +++ b/Pearlception/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ class ApplicationController < ActionController::Base - protect_from_forgery with: :exception + #protect_from_forgery with: :exception protected def authenticate_user diff --git a/Pearlception/app/controllers/sessions_controller.rb b/Pearlception/app/controllers/sessions_controller.rb index 29ab135..a437024 100644 --- a/Pearlception/app/controllers/sessions_controller.rb +++ b/Pearlception/app/controllers/sessions_controller.rb @@ -6,7 +6,6 @@ class SessionsController < Devise::RegistrationsController end def create - puts "NOW IN CREATE" params = sign_in_params @user = User.find_by(email: params[:email]) if @user == nil || !@user.valid_password?(params[:password]) @@ -19,7 +18,7 @@ class SessionsController < Devise::RegistrationsController if !current_user.admin Apartment::Tenant.switch!(Company.find(current_user.company_id).company_name.gsub(/'/,'').gsub(/\s/,'')) end - redirect_to "/" + redirect_to "/pearlception" end private diff --git a/Pearlception/app/models/oyster.rb b/Pearlception/app/models/oyster.rb index 799448e..54b1937 100644 --- a/Pearlception/app/models/oyster.rb +++ b/Pearlception/app/models/oyster.rb @@ -1,12 +1,4 @@ class Oyster < ApplicationRecord belongs_to :run - #Oyster.establish_connection(:"stats_#{Rails.env}") - #Oyster.establish_connection( - #:adapter => "mysql2", - #:host => ENV['STATS_DB_URL'], - #:username => ENV['STATS_DB_USER'], - #:password => ENV['STATS_DB_PASS'], - #:database => "main" - #) scope :run_id, -> (id) { where run_id: id.to_i } end diff --git a/Pearlception/app/models/run.rb b/Pearlception/app/models/run.rb index be69ff8..8b28af0 100644 --- a/Pearlception/app/models/run.rb +++ b/Pearlception/app/models/run.rb @@ -1,12 +1,3 @@ class Run < ApplicationRecord has_many :oysters - #belongs_to :companies - # establish_connection(:"stats_#{Rails.env}") - #Run.establish_connection( - #:adapter => "mysql2", - #:host => ENV['STATS_DB_URL'], - #:username => ENV['STATS_DB_USER'], - #:password => ENV['STATS_DB_PASS'], - #:database => "main" - #) end diff --git a/Pearlception/config/routes.rb b/Pearlception/config/routes.rb index 53f700a..5d5249b 100644 --- a/Pearlception/config/routes.rb +++ b/Pearlception/config/routes.rb @@ -1,8 +1,7 @@ require 'subdomain' Rails.application.routes.draw do - constraints(Subdomain) do - root 'dashboard#index' + get '/pearlception', to: "dashboard#index" # More subdomain constrained routes... get 'oysters/show' get 'oysters/index' @@ -20,7 +19,6 @@ Rails.application.routes.draw do get 'signin' => 'sessions#new' post 'signin' => 'sessions#create' end - end #binding.pry