mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 19:57:41 +00:00
Merged branch master into User-Sign-In-Sign-Up
This commit is contained in:
commit
36c641d236
4
Pearlception/.pryrc
Normal file
4
Pearlception/.pryrc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
if Rails.env.development? || Rails.env.test?
|
||||||
|
# This introduces the `table` statement
|
||||||
|
extend Hirb::Console
|
||||||
|
end
|
||||||
@ -36,6 +36,8 @@ gem 'bcrypt', '~> 3.1.7'
|
|||||||
# gem 'capistrano-rails', group: :development
|
# gem 'capistrano-rails', group: :development
|
||||||
# for sign in sign up
|
# for sign in sign up
|
||||||
gem 'devise'
|
gem 'devise'
|
||||||
|
#for pagination
|
||||||
|
gem 'kaminari'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
|
||||||
@ -49,7 +51,21 @@ group :development do
|
|||||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
||||||
gem 'spring'
|
gem 'spring'
|
||||||
gem 'spring-watcher-listen', '~> 2.0.0'
|
gem 'spring-watcher-listen', '~> 2.0.0'
|
||||||
|
gem 'awesome_rails_console'
|
||||||
|
gem 'hirb'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
|
||||||
|
|
||||||
|
# Please clean up duplicated gems if any.
|
||||||
|
# Feel free to remove gems that you don't want to use or if they conflict with other gem dependencies. (you might need to update .pryrc also)
|
||||||
|
group :development, :test do
|
||||||
|
gem 'hirb'
|
||||||
|
gem 'hirb-unicode'
|
||||||
|
gem 'pry-byebug'
|
||||||
|
gem 'pry-stack_explorer'
|
||||||
|
end
|
||||||
|
|
||||||
|
group :development, :test do
|
||||||
|
end
|
||||||
|
|||||||
@ -39,9 +39,17 @@ GEM
|
|||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
arel (7.1.4)
|
arel (7.1.4)
|
||||||
|
awesome_print (1.7.0)
|
||||||
|
awesome_rails_console (0.4.0)
|
||||||
|
awesome_print
|
||||||
|
pry-rails
|
||||||
|
railties
|
||||||
bcrypt (3.1.11)
|
bcrypt (3.1.11)
|
||||||
|
binding_of_caller (0.7.2)
|
||||||
|
debug_inspector (>= 0.0.1)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (9.0.6)
|
byebug (9.0.6)
|
||||||
|
coderay (1.1.1)
|
||||||
coffee-rails (4.2.1)
|
coffee-rails (4.2.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.2.x)
|
railties (>= 4.0.0, < 5.2.x)
|
||||||
@ -62,6 +70,10 @@ GEM
|
|||||||
ffi (1.9.14)
|
ffi (1.9.14)
|
||||||
globalid (0.3.7)
|
globalid (0.3.7)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
|
hirb (0.7.3)
|
||||||
|
hirb-unicode (0.0.5)
|
||||||
|
hirb (~> 0.5)
|
||||||
|
unicode-display_width (~> 0.1.1)
|
||||||
i18n (0.7.0)
|
i18n (0.7.0)
|
||||||
jbuilder (2.6.1)
|
jbuilder (2.6.1)
|
||||||
activesupport (>= 3.0.0, < 5.1)
|
activesupport (>= 3.0.0, < 5.1)
|
||||||
@ -70,6 +82,18 @@ GEM
|
|||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
|
kaminari (1.0.1)
|
||||||
|
activesupport (>= 4.1.0)
|
||||||
|
kaminari-actionview (= 1.0.1)
|
||||||
|
kaminari-activerecord (= 1.0.1)
|
||||||
|
kaminari-core (= 1.0.1)
|
||||||
|
kaminari-actionview (1.0.1)
|
||||||
|
actionview
|
||||||
|
kaminari-core (= 1.0.1)
|
||||||
|
kaminari-activerecord (1.0.1)
|
||||||
|
activerecord
|
||||||
|
kaminari-core (= 1.0.1)
|
||||||
|
kaminari-core (1.0.1)
|
||||||
listen (3.0.8)
|
listen (3.0.8)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
@ -89,6 +113,18 @@ GEM
|
|||||||
nokogiri (1.7.0)
|
nokogiri (1.7.0)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
|
pry (0.10.4)
|
||||||
|
coderay (~> 1.1.0)
|
||||||
|
method_source (~> 0.8.1)
|
||||||
|
slop (~> 3.4)
|
||||||
|
pry-byebug (3.4.2)
|
||||||
|
byebug (~> 9.0)
|
||||||
|
pry (~> 0.10)
|
||||||
|
pry-rails (0.3.4)
|
||||||
|
pry (>= 0.9.10)
|
||||||
|
pry-stack_explorer (0.4.9.2)
|
||||||
|
binding_of_caller (>= 0.7)
|
||||||
|
pry (>= 0.9.11)
|
||||||
puma (3.6.2)
|
puma (3.6.2)
|
||||||
rack (2.0.1)
|
rack (2.0.1)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
@ -129,6 +165,7 @@ GEM
|
|||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
|
slop (3.6.0)
|
||||||
spring (2.0.0)
|
spring (2.0.0)
|
||||||
activesupport (>= 4.2)
|
activesupport (>= 4.2)
|
||||||
spring-watcher-listen (2.0.1)
|
spring-watcher-listen (2.0.1)
|
||||||
@ -151,6 +188,7 @@ GEM
|
|||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (3.0.4)
|
uglifier (3.0.4)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
|
unicode-display_width (0.1.1)
|
||||||
warden (1.2.6)
|
warden (1.2.6)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
web-console (3.4.0)
|
web-console (3.4.0)
|
||||||
@ -166,14 +204,20 @@ PLATFORMS
|
|||||||
ruby
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
|
awesome_rails_console
|
||||||
bcrypt (~> 3.1.7)
|
bcrypt (~> 3.1.7)
|
||||||
byebug
|
byebug
|
||||||
coffee-rails (~> 4.2)
|
coffee-rails (~> 4.2)
|
||||||
devise
|
devise
|
||||||
|
hirb
|
||||||
|
hirb-unicode
|
||||||
jbuilder (~> 2.5)
|
jbuilder (~> 2.5)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
kaminari
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
|
pry-byebug
|
||||||
|
pry-stack_explorer
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
rails (~> 5.0.1)
|
rails (~> 5.0.1)
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
|
|||||||
BIN
Pearlception/app/assets/images/ajax-loader.gif
Normal file
BIN
Pearlception/app/assets/images/ajax-loader.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
3
Pearlception/app/assets/javascripts/companies.coffee
Normal file
3
Pearlception/app/assets/javascripts/companies.coffee
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://coffeescript.org/
|
||||||
3
Pearlception/app/assets/stylesheets/companies.scss
Normal file
3
Pearlception/app/assets/stylesheets/companies.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
// Place all the styles related to the Companies controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||||
22
Pearlception/app/assets/stylesheets/custom.scss
Normal file
22
Pearlception/app/assets/stylesheets/custom.scss
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//@import "bootstrap-sprockets";
|
||||||
|
@import "bootstrap";
|
||||||
|
|
||||||
|
/* mixins, variables, etc. */
|
||||||
|
|
||||||
|
$gray-medium-light: #eaeaea;
|
||||||
|
|
||||||
|
@mixin box_sizing {
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* miscellaneous */
|
||||||
|
|
||||||
|
.debug_dump {
|
||||||
|
clear: both;
|
||||||
|
float: left;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 45px;
|
||||||
|
@include box_sizing;
|
||||||
|
}
|
||||||
32
Pearlception/app/controllers/companies_controller.rb
Normal file
32
Pearlception/app/controllers/companies_controller.rb
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
class CompaniesController < ApplicationController
|
||||||
|
require 'securerandom'
|
||||||
|
before_filter :deny_to_visitors
|
||||||
|
|
||||||
|
def new
|
||||||
|
@company = Company.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@company = Company.new(company_params)
|
||||||
|
@company.company_token = SecureRandom.uuid
|
||||||
|
|
||||||
|
if @company.save
|
||||||
|
redirect_to :action => 'index'
|
||||||
|
else
|
||||||
|
flash[:alert] = @company.errors.full_messages.to_sentence
|
||||||
|
redirect_to :action => 'new'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@companies = Company.all
|
||||||
|
end
|
||||||
|
|
||||||
|
def deny_to_visitors
|
||||||
|
redirect_to "/signin" unless user_signed_in? && current_user.admin?
|
||||||
|
end
|
||||||
|
|
||||||
|
def company_params
|
||||||
|
params.require(:company).permit(:company_name, :company_token)
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -1,7 +1,13 @@
|
|||||||
class DashboardController < ApplicationController
|
class DashboardController < ApplicationController
|
||||||
|
before_filter :deny_to_visitors
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@results = Result.page(params[:page]).per(5)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def deny_to_visitors
|
||||||
|
redirect_to "/signin" unless user_signed_in?
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,7 +1,23 @@
|
|||||||
class RegistrationsController < Devise::RegistrationsController
|
class RegistrationsController < Devise::RegistrationsController
|
||||||
private
|
include ApplicationHelper
|
||||||
|
#protected
|
||||||
|
|
||||||
|
def create
|
||||||
|
binding.pry
|
||||||
|
@user = User.new(sign_up_params)
|
||||||
|
if !@user.admin?
|
||||||
|
#search by company token given by one of pearlception admins to the company
|
||||||
|
#and look up comany_id #
|
||||||
|
@user.company_id = 0
|
||||||
|
else
|
||||||
|
@user.company_id = -1
|
||||||
|
end
|
||||||
|
@user.save
|
||||||
|
sign_in @user
|
||||||
|
redirect_to "/"
|
||||||
|
end
|
||||||
|
|
||||||
def sign_up_params
|
def sign_up_params
|
||||||
params.require(:user).permit(:company_id, :email, :password, :password_confirmation)
|
params.require(:user).permit(:email, :password, :password_confirmation, :company_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,2 +1,13 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
def resource_name
|
||||||
|
:user
|
||||||
|
end
|
||||||
|
|
||||||
|
def resource
|
||||||
|
@resource ||= User.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def devise_mapping
|
||||||
|
@devise_mapping ||= Devise.mappings[:user]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
2
Pearlception/app/helpers/companies_helper.rb
Normal file
2
Pearlception/app/helpers/companies_helper.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
module CompaniesHelper
|
||||||
|
end
|
||||||
@ -1,3 +1,4 @@
|
|||||||
class Company < ApplicationRecord
|
class Company < ApplicationRecord
|
||||||
belongs_to :user
|
has_many :users
|
||||||
|
has_many :runs
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
class Oyster < ApplicationRecord
|
class Oyster < ApplicationRecord
|
||||||
belongs_to :run
|
belongs_to :run
|
||||||
Oyster.establish_connection(:"stats_#{Rails.env}")
|
#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"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,3 +1,10 @@
|
|||||||
class Result < ApplicationRecord
|
class Result < ApplicationRecord
|
||||||
establish_connection(:"stats_#{Rails.env}")
|
#establish_connection(:"stats_#{Rails.env}")
|
||||||
|
Result.establish_connection(
|
||||||
|
:adapter => "mysql2",
|
||||||
|
:host => ENV['STATS_DB_URL'],
|
||||||
|
:username => ENV['STATS_DB_USER'],
|
||||||
|
:password => ENV['STATS_DB_PASS'],
|
||||||
|
:database => "main"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,12 @@
|
|||||||
class Run < ApplicationRecord
|
class Run < ApplicationRecord
|
||||||
has_many :oysters
|
has_many :oysters
|
||||||
establish_connection(:"stats_#{Rails.env}")
|
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
|
end
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
class User < ApplicationRecord
|
class User < ApplicationRecord
|
||||||
|
belongs_to :company
|
||||||
|
has_many :runs
|
||||||
# Include default devise modules. Others available are:
|
# Include default devise modules. Others available are:
|
||||||
# :confirmable, :lockable, :timeoutable and :omniauthable
|
# :confirmable, :lockable, :timeoutable and :omniauthable
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
|
|||||||
111
Pearlception/app/views/companies/index.html.erb
Normal file
111
Pearlception/app/views/companies/index.html.erb
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<%= stylesheet_link_tag "dashboard" %>_
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="/">Pearlception</a>
|
||||||
|
</div>
|
||||||
|
<div id="navbar" class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<!-- <li><a href="#">Dashboard</a></li> -->
|
||||||
|
<!-- <li><a href="#">Settings</a></li>
|
||||||
|
<li><a href="#">Profile</a></li>
|
||||||
|
<li><a href="#">Help</a></li> -->
|
||||||
|
<li>
|
||||||
|
<%= link_to(destroy_user_session_path, class: 'logout-link', :method => :delete) do %>
|
||||||
|
<i class="fa fa-external-link"></i> Logout
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- <form class="navbar-form navbar-right">
|
||||||
|
<input type="text" class="form-control" placeholder="Search...">
|
||||||
|
</form> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 col-md-2 sidebar">
|
||||||
|
<ul class="nav nav-sidebar">
|
||||||
|
<li><a href="/">Overview <span class="sr-only">(current)</span></a></li>
|
||||||
|
<% if current_user.admin? %>
|
||||||
|
<li class="active"><a href="companies#index">Companies</a></li>
|
||||||
|
<% else %>
|
||||||
|
<li><a href="#">Reports</a></li>
|
||||||
|
<li><a href="#">Analytics</a></li>
|
||||||
|
<li><a href="#">Export</a></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<!-- <ul class="nav nav-sidebar">
|
||||||
|
<li><a href="">Nav item</a></li>
|
||||||
|
<li><a href="">Nav item again</a></li>
|
||||||
|
<li><a href="">One more nav</a></li>
|
||||||
|
<li><a href="">Another nav item</a></li>
|
||||||
|
<li><a href="">More navigation</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav nav-sidebar">
|
||||||
|
<li><a href="">Nav item again</a></li>
|
||||||
|
<li><a href="">One more nav</a></li>
|
||||||
|
<li><a href="">Another nav item</a></li>
|
||||||
|
</ul> -->
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||||
|
<h1 class="page-header">Companies</h1>
|
||||||
|
<h2 class="sub-header">Registered Companies: <%= @companies.count %> </h2>
|
||||||
|
<div class="panel panel-primary table-responsive">
|
||||||
|
<%= link_to(new_company_path, :method => :get) do %>
|
||||||
|
<i class="fa fa-external-link"></i> Register a Company
|
||||||
|
<% end %>
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Company ID</th>
|
||||||
|
<th>Company Name</th>
|
||||||
|
<th>Registration Serial Key</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<% if @companies.empty? %>
|
||||||
|
</table>
|
||||||
|
<div class="panel panel-primary">
|
||||||
|
<p>No Companies Registered</p>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<tbody>
|
||||||
|
<% @companies.each_slice(1) do |row| %>
|
||||||
|
<tr>
|
||||||
|
<% row.each do |company|%>
|
||||||
|
|
||||||
|
<!-- company id -->
|
||||||
|
<td>
|
||||||
|
<%= company.id %>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- company_name -->
|
||||||
|
<td>
|
||||||
|
<%= company.company_name %>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- company registration token -->
|
||||||
|
<td>
|
||||||
|
<%= company.company_token %>
|
||||||
|
</td>
|
||||||
|
<% end %>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= javascript_include_tag "bootstrap.min" %>_
|
||||||
|
</body>
|
||||||
83
Pearlception/app/views/companies/new.html.erb
Normal file
83
Pearlception/app/views/companies/new.html.erb
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<%= stylesheet_link_tag "dashboard" %>_
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="navbar-header">
|
||||||
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||||
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
<span class="icon-bar"></span>
|
||||||
|
</button>
|
||||||
|
<a class="navbar-brand" href="/">Pearlception</a>
|
||||||
|
</div>
|
||||||
|
<div id="navbar" class="navbar-collapse collapse">
|
||||||
|
<ul class="nav navbar-nav navbar-right">
|
||||||
|
<!-- <li><a href="#">Dashboard</a></li> -->
|
||||||
|
<!-- <li><a href="#">Settings</a></li>
|
||||||
|
<li><a href="#">Profile</a></li>
|
||||||
|
<li><a href="#">Help</a></li> -->
|
||||||
|
<li>
|
||||||
|
<%= link_to(destroy_user_session_path, class: 'logout-link', :method => :delete) do %>
|
||||||
|
<i class="fa fa-external-link"></i> Logout
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- <form class="navbar-form navbar-right">
|
||||||
|
<input type="text" class="form-control" placeholder="Search...">
|
||||||
|
</form> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3 col-md-2 sidebar">
|
||||||
|
<ul class="nav nav-sidebar">
|
||||||
|
<li><a href="/">Overview <span class="sr-only">(current)</span></a></li>
|
||||||
|
<% if current_user.admin? %>
|
||||||
|
<li class="active"><a href="companies#index">Companies</a></li>
|
||||||
|
<% else %>
|
||||||
|
<li><a href="#">Reports</a></li>
|
||||||
|
<li><a href="#">Analytics</a></li>
|
||||||
|
<li><a href="#">Export</a></li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
<!-- <ul class="nav nav-sidebar">
|
||||||
|
<li><a href="">Nav item</a></li>
|
||||||
|
<li><a href="">Nav item again</a></li>
|
||||||
|
<li><a href="">One more nav</a></li>
|
||||||
|
<li><a href="">Another nav item</a></li>
|
||||||
|
<li><a href="">More navigation</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="nav nav-sidebar">
|
||||||
|
<li><a href="">Nav item again</a></li>
|
||||||
|
<li><a href="">One more nav</a></li>
|
||||||
|
<li><a href="">Another nav item</a></li>
|
||||||
|
</ul> -->
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||||
|
<h1 class="page-header">Companies</h1>
|
||||||
|
<h2 class="sub-header">Register a New Company</h2>
|
||||||
|
<div class="panel panel-primary">
|
||||||
|
<%= link_to(companies_path, :method => :get) do %>
|
||||||
|
<i class="fa fa-external-link"></i> Back
|
||||||
|
<% end %>
|
||||||
|
<%= form_for @company, url: {action: "create"}, html: {class: "company_form"} do |f| %>
|
||||||
|
<div class="field form-group">
|
||||||
|
<%= f.text_field :company_name, class: 'form-control', placeholder: 'Company Name' %>
|
||||||
|
</div>
|
||||||
|
<div class="actions">
|
||||||
|
<%= f.submit "Create" %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= javascript_include_tag "bootstrap.min" %>_
|
||||||
|
</body>
|
||||||
@ -10,18 +10,23 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="#">Pearlception</a>
|
<a class="navbar-brand" href="/">Pearlception</a>
|
||||||
</div>
|
</div>
|
||||||
<div id="navbar" class="navbar-collapse collapse">
|
<div id="navbar" class="navbar-collapse collapse">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li><a href="#">Dashboard</a></li>
|
<!-- <li><a href="#">Dashboard</a></li> -->
|
||||||
<li><a href="#">Settings</a></li>
|
<!-- <li><a href="#">Settings</a></li>
|
||||||
<li><a href="#">Profile</a></li>
|
<li><a href="#">Profile</a></li>
|
||||||
<li><a href="#">Help</a></li>
|
<li><a href="#">Help</a></li> -->
|
||||||
|
<li>
|
||||||
|
<%= link_to(destroy_user_session_path, class: 'logout-link', :method => :delete) do %>
|
||||||
|
<i class="fa fa-external-link"></i> Logout
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="navbar-form navbar-right">
|
<!-- <form class="navbar-form navbar-right">
|
||||||
<input type="text" class="form-control" placeholder="Search...">
|
<input type="text" class="form-control" placeholder="Search...">
|
||||||
</form>
|
</form> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
@ -30,12 +35,17 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3 col-md-2 sidebar">
|
<div class="col-sm-3 col-md-2 sidebar">
|
||||||
<ul class="nav nav-sidebar">
|
<ul class="nav nav-sidebar">
|
||||||
<li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li>
|
<li class="active"><a href="/">Overview <span class="sr-only">(current)</span></a></li>
|
||||||
<li><a href="#">Reports</a></li>
|
<!-- This will be removed and placed with correct logic in corresponding controller -->
|
||||||
<li><a href="#">Analytics</a></li>
|
<% if current_user.admin? %>
|
||||||
<li><a href="#">Export</a></li>
|
<li><a href="companies#index">Companies</a></li>
|
||||||
|
<% else %>
|
||||||
|
<!-- <li><a>Reports</a></li>
|
||||||
|
<li><a>Analytics</a></li>
|
||||||
|
<li><a>Export</a></li> -->
|
||||||
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav nav-sidebar">
|
<!-- <ul class="nav nav-sidebar">
|
||||||
<li><a href="">Nav item</a></li>
|
<li><a href="">Nav item</a></li>
|
||||||
<li><a href="">Nav item again</a></li>
|
<li><a href="">Nav item again</a></li>
|
||||||
<li><a href="">One more nav</a></li>
|
<li><a href="">One more nav</a></li>
|
||||||
@ -46,12 +56,12 @@
|
|||||||
<li><a href="">Nav item again</a></li>
|
<li><a href="">Nav item again</a></li>
|
||||||
<li><a href="">One more nav</a></li>
|
<li><a href="">One more nav</a></li>
|
||||||
<li><a href="">Another nav item</a></li>
|
<li><a href="">Another nav item</a></li>
|
||||||
</ul>
|
</ul> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
|
||||||
<h1 class="page-header">Pearlception Dashboard</h1>
|
<h1 class="page-header">Pearlception Dashboard</h1>
|
||||||
|
|
||||||
<div class="row placeholders">
|
<!-- <div class="row placeholders">
|
||||||
<div class="col-xs-6 col-sm-3 placeholder">
|
<div class="col-xs-6 col-sm-3 placeholder">
|
||||||
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAHd3dwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==" width="200" height="200" class="img-responsive" alt="Generic placeholder thumbnail">
|
||||||
<h4>Label</h4>
|
<h4>Label</h4>
|
||||||
@ -72,135 +82,134 @@
|
|||||||
<h4>Label</h4>
|
<h4>Label</h4>
|
||||||
<span class="text-muted">Something else</span>
|
<span class="text-muted">Something else</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<h2 class="sub-header">Recent Results</h2>
|
<% if current_user.admin? %>
|
||||||
|
<h2 class="sub-header">Recent Results From All Companies</h2>
|
||||||
|
<% else %>
|
||||||
|
<h2 class="sub-header">Recent Results</h2>
|
||||||
|
<% end %>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<% if current_user.admin? %>
|
||||||
<th>Header</th>
|
<th>Company</th>
|
||||||
<th>Header</th>
|
<% end %>
|
||||||
<th>Header</th>
|
<th>Run Date</th>
|
||||||
<th>Header</th>
|
<th>Location</th>
|
||||||
|
<th>Harvest Time</th>
|
||||||
|
<th>Supplier</th>
|
||||||
|
<th>Distributor</th>
|
||||||
|
<th>Total Processed</th>
|
||||||
|
<th>Other</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<% if current_user.admin? %>
|
||||||
<td>1,001</td>
|
<% @results.each_slice(1) do |row| %>
|
||||||
<td>Lorem</td>
|
<tr>
|
||||||
<td>ipsum</td>
|
<% row.each do |result|
|
||||||
<td>dolor</td>
|
run = Run.find(result.id)
|
||||||
<td>sit</td>
|
#company = Company.find(run.company_id)
|
||||||
</tr>
|
%>
|
||||||
<tr>
|
|
||||||
<td>1,002</td>
|
<!-- company name -->
|
||||||
<td>amet</td>
|
<td>
|
||||||
<td>consectetur</td>
|
<%= #company.company_name
|
||||||
<td>adipiscing</td>
|
"Fake Industries" %>
|
||||||
<td>elit</td>
|
</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
<!-- run date -->
|
||||||
<td>1,003</td>
|
<td>
|
||||||
<td>Integer</td>
|
<%= run.runDate %>
|
||||||
<td>nec</td>
|
</td>
|
||||||
<td>odio</td>
|
|
||||||
<td>Praesent</td>
|
<!-- location -->
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
<%= run.location ? run.location : "" %>
|
||||||
<td>1,003</td>
|
</td>
|
||||||
<td>libero</td>
|
|
||||||
<td>Sed</td>
|
<!-- harvest time -->
|
||||||
<td>cursus</td>
|
<td>
|
||||||
<td>ante</td>
|
<%= "" %>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
|
||||||
<td>1,004</td>
|
<!-- supplier -->
|
||||||
<td>dapibus</td>
|
<td>
|
||||||
<td>diam</td>
|
|
||||||
<td>Sed</td>
|
<%= run.supplier ? run.supplier : "" %>
|
||||||
<td>nisi</td>
|
</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
<!-- distributor -->
|
||||||
<td>1,005</td>
|
<td>
|
||||||
<td>Nulla</td>
|
<%= run.distributor ? run.distributor : "" %>
|
||||||
<td>quis</td>
|
</td>
|
||||||
<td>sem</td>
|
|
||||||
<td>at</td>
|
<!-- total processed -->
|
||||||
</tr>
|
<td>
|
||||||
<tr>
|
<%= result.total %>
|
||||||
<td>1,006</td>
|
</td>
|
||||||
<td>nibh</td>
|
|
||||||
<td>elementum</td>
|
<!-- other -->
|
||||||
<td>imperdiet</td>
|
<td>
|
||||||
<td>Duis</td>
|
<%= run.other ? run.other : "" %>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
<% end %>
|
||||||
<td>1,007</td>
|
</tr>
|
||||||
<td>sagittis</td>
|
<% end %>
|
||||||
<td>ipsum</td>
|
<% else %>
|
||||||
<td>Praesent</td>
|
<% @results.each_slice(1) do |row| %>
|
||||||
<td>mauris</td>
|
<tr>
|
||||||
</tr>
|
<% row.each do |result|
|
||||||
<tr>
|
run = Run.find(result.id) %>
|
||||||
<td>1,008</td>
|
<!-- run date -->
|
||||||
<td>Fusce</td>
|
<td>
|
||||||
<td>nec</td>
|
<%= run.runDate %>
|
||||||
<td>tellus</td>
|
</td>
|
||||||
<td>sed</td>
|
|
||||||
</tr>
|
<!-- location -->
|
||||||
<tr>
|
<td>
|
||||||
<td>1,009</td>
|
<%= run.location ? run.location : "" %>
|
||||||
<td>augue</td>
|
</td>
|
||||||
<td>semper</td>
|
|
||||||
<td>porta</td>
|
<!-- harvest time -->
|
||||||
<td>Mauris</td>
|
<td>
|
||||||
</tr>
|
<%= "" %>
|
||||||
<tr>
|
</td>
|
||||||
<td>1,010</td>
|
|
||||||
<td>massa</td>
|
<!-- supplier -->
|
||||||
<td>Vestibulum</td>
|
<td>
|
||||||
<td>lacinia</td>
|
|
||||||
<td>arcu</td>
|
<%= run.supplier ? run.supplier : "" %>
|
||||||
</tr>
|
</td>
|
||||||
<tr>
|
|
||||||
<td>1,011</td>
|
<!-- distributor -->
|
||||||
<td>eget</td>
|
<td>
|
||||||
<td>nulla</td>
|
<%= run.distributor ? run.distributor : "" %>
|
||||||
<td>Class</td>
|
</td>
|
||||||
<td>aptent</td>
|
|
||||||
</tr>
|
<!-- total processed -->
|
||||||
<tr>
|
<td>
|
||||||
<td>1,012</td>
|
<%= result.total %>
|
||||||
<td>taciti</td>
|
</td>
|
||||||
<td>sociosqu</td>
|
|
||||||
<td>ad</td>
|
<!-- other -->
|
||||||
<td>litora</td>
|
<td>
|
||||||
</tr>
|
<%= run.other ? run.other : "" %>
|
||||||
<tr>
|
</td>
|
||||||
<td>1,013</td>
|
<% end %>
|
||||||
<td>torquent</td>
|
</tr>
|
||||||
<td>per</td>
|
<% end %>
|
||||||
<td>conubia</td>
|
<% end %>
|
||||||
<td>nostra</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1,014</td>
|
|
||||||
<td>per</td>
|
|
||||||
<td>inceptos</td>
|
|
||||||
<td>himenaeos</td>
|
|
||||||
<td>Curabitur</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>1,015</td>
|
|
||||||
<td>sodales</td>
|
|
||||||
<td>ligula</td>
|
|
||||||
<td>in</td>
|
|
||||||
<td>libero</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div class="center-block">
|
||||||
|
<div class="col-sm-6 panel panel-primary" align="center">
|
||||||
|
<%= paginate @results %><br>
|
||||||
|
<%= page_entries_info @results %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,17 +6,17 @@
|
|||||||
<%= javascript_include_tag "application", "data-turbolinks-track" => false %>
|
<%= javascript_include_tag "application", "data-turbolinks-track" => false %>
|
||||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= yield %>
|
<% if notice %>
|
||||||
|
<p class="alert alert-success" align="center"><%= notice %></p>
|
||||||
|
<% end %>
|
||||||
|
<% if alert %>
|
||||||
|
<p class="alert alert-danger" align="center"><%= alert %></p>
|
||||||
|
<% end %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<% if notice %>
|
|
||||||
<p class="alert alert-success"><%= notice %></p>
|
|
||||||
<% end %>
|
|
||||||
<% if alert %>
|
|
||||||
<p class="alert alert-danger"><%= alert %></p>
|
|
||||||
<% end %>
|
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
|
<%= debug(params) if Rails.env.development? %>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<h2>Sign up</h2>
|
<h2>Sign up!</h2>
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
||||||
<%= devise_error_messages! %>
|
<%= devise_error_messages! %>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<h2>Log in</h2>
|
<h2>Log</h2>
|
||||||
|
|
||||||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
|
|||||||
@ -34,6 +34,12 @@ stats_test:
|
|||||||
development:
|
development:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: Pearlception_development
|
database: Pearlception_development
|
||||||
|
username: <%= ENV['DEV_DB_USER'] %>
|
||||||
|
password: <%= ENV['DEV_DB_PASS'] %>
|
||||||
|
#host: <%= ENV['DEV_DB_URL'] %>
|
||||||
|
host: localhost
|
||||||
|
port: 3306
|
||||||
|
#database: main
|
||||||
|
|
||||||
# Warning: The database defined as "test" will be erased and
|
# Warning: The database defined as "test" will be erased and
|
||||||
# re-generated from your development database when you run "rake".
|
# re-generated from your development database when you run "rake".
|
||||||
@ -41,6 +47,12 @@ development:
|
|||||||
test:
|
test:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: Pearlception_test
|
database: Pearlception_test
|
||||||
|
username: <%= ENV['DEV_DB_USER'] %>
|
||||||
|
password: <%= ENV['DEV_DB_PASS'] %>
|
||||||
|
#host: <%= ENV['DEV_DB_URL'] %>
|
||||||
|
host: localhost
|
||||||
|
port: 3306
|
||||||
|
#database: main
|
||||||
|
|
||||||
# As with config/secrets.yml, you never want to store sensitive information,
|
# As with config/secrets.yml, you never want to store sensitive information,
|
||||||
# like your database password, in your source code. If your source code is
|
# like your database password, in your source code. If your source code is
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
devise_for :users, :controllers => { registrations: 'registrations' }
|
|
||||||
|
|
||||||
root "dashboard#index"
|
root "dashboard#index"
|
||||||
resources :runs
|
resources :runs
|
||||||
|
resources :companies
|
||||||
|
|
||||||
|
devise_for :users, :controllers => {:registrations => 'registrations'}
|
||||||
|
devise_scope :users do
|
||||||
|
get 'signin' => 'registrations#new'
|
||||||
|
post 'signin' => 'registrations#create'
|
||||||
|
end
|
||||||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||||
end
|
end
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
class ChangeCompanyIdTypeInUsers < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
change_column :users, :company_id, :integer, default: -1
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -10,8 +10,7 @@
|
|||||||
#
|
#
|
||||||
# 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.
|
||||||
|
|
||||||
<<<<<<< HEAD
|
ActiveRecord::Schema.define(version: 20170119161737) do
|
||||||
ActiveRecord::Schema.define(version: 20170109174008) do
|
|
||||||
|
|
||||||
create_table "companies", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
create_table "companies", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
||||||
t.string "company_name"
|
t.string "company_name"
|
||||||
@ -21,24 +20,22 @@ ActiveRecord::Schema.define(version: 20170109174008) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "encrypted_password", default: "", null: false
|
t.string "encrypted_password", default: "", null: false
|
||||||
t.integer "company_id", null: false
|
t.integer "company_id", null: false
|
||||||
|
t.boolean "admin", default: false, null: false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.datetime "reset_password_sent_at"
|
t.datetime "reset_password_sent_at"
|
||||||
t.datetime "remember_created_at"
|
t.datetime "remember_created_at"
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
t.datetime "current_sign_in_at"
|
t.datetime "current_sign_in_at"
|
||||||
t.datetime "last_sign_in_at"
|
t.datetime "last_sign_in_at"
|
||||||
t.string "current_sign_in_ip"
|
t.string "current_sign_in_ip"
|
||||||
t.string "last_sign_in_ip"
|
t.string "last_sign_in_ip"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
|
t.index ["email"], name: "index_users_on_email", unique: true, using: :btree
|
||||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
|
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
|
||||||
end
|
end
|
||||||
=======
|
|
||||||
ActiveRecord::Schema.define(version: 0) do
|
|
||||||
>>>>>>> master
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class CompaniesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user