Fixed routes

This commit is contained in:
bmv root 2017-04-24 23:19:05 -04:00
parent 87d4a4185f
commit 58259d5a83
5 changed files with 3 additions and 23 deletions

View File

@ -1,5 +1,5 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
#protect_from_forgery with: :exception
protected
def authenticate_user

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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