This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Devise.setup do |config| | |
# The secret key used by Devise. Devise uses this key to generate | |
# random tokens. Changing this key will render invalid all existing | |
# confirmation, reset password and unlock tokens in the database. | |
# config.secret_key = '742cdc01b4108ab9bd9389fe941ac993241c9d02c37add6e9d3e37a853f045eeb51227ff669bbbff77001850714e6d681c0f4d7e25a9acadc9c104bff4c5ffec' | |
config.secret_key = '06aea70e1d7f803dad72170c5c48b29acea8499c9af6d4c3dcfee0de8777961f8ccef2d99be804e06f5ba10ef90e998f0069c7c36ed6fdd3522042ce59ea48a2' | |
# ==> Mailer Configuration | |
# Configure the e-mail address which will be shown in Devise::Mailer, | |
# note that it will be overwritten if you use your own mailer class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# In the development environment your application's code is reloaded on | |
# every request. This slows down response time but is perfect for development | |
# since you don't have to restart the web server when you make code changes. | |
config.cache_classes = false | |
# Do not eager load code on boot. | |
config.eager_load = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# Code is not reloaded between requests. | |
config.cache_classes = true | |
# Eager load code on boot. This eager loads most of Rails and | |
# your application in memory, allowing both threaded web servers | |
# and those relying on copy on write to perform better. | |
# Rake tasks automatically ignore this option for performance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
# In the development environment your application's code is reloaded on | |
# every request. This slows down response time but is perfect for development | |
# since you don't have to restart the web server when you make code changes. | |
config.cache_classes = false | |
# Do not eager load code on boot. | |
config.eager_load = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1m[36mCompany Load (0.1ms)[0m [1mSELECT `companies`.* FROM `companies` WHERE `companies`.`email` = 'dinam@dinam.com.br' ORDER BY `companies`.`id` ASC LIMIT 1[0m | |
Started GET "/" for 127.0.0.1 at 2015-03-25 14:30:24 -0300 | |
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT `schema_migrations`.* FROM `schema_migrations` | |
Processing by HomeController#index as HTML | |
Completed 401 Unauthorized in 15ms | |
Started GET "/" for 127.0.0.1 at 2015-03-25 14:30:25 -0300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1m[36mCompany Load (0.1ms)[0m [1mSELECT `companies`.* FROM `companies` WHERE `companies`.`email` = 'dinam@dinam.com.br' ORDER BY `companies`.`id` ASC LIMIT 1[0m | |
Started GET "/" for 127.0.0.1 at 2015-03-25 17:33:41 -0300 | |
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT `schema_migrations`.* FROM `schema_migrations` | |
Processing by HomeController#index as HTML | |
Completed 401 Unauthorized in 15ms | |
Started GET "/" for 127.0.0.1 at 2015-03-25 17:33:42 -0300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
belongs_to :company | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, | |
:recoverable, :rememberable, :trackable, :validatable, :confirmable | |
# Create a password reset token for this user, saves it encrypted and returns the raw token text | |
def setup_password_reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CompaniesController < ApplicationController | |
before_action :set_company, :only => [:show, :update, :add] | |
def show | |
authorize! 'read_company', @company | |
render :json => @company, :methods => [:factor_ids, :daily_limit, :company_types] | |
end | |
def factors | |
if current_user.is_superuser | |
@factors = Company.all.joins('JOIN current_accounts ON companies.id = current_accounts.client_id').where('current_accounts.company_type = ?', 'factor') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" ng-app> | |
<head> | |
<meta charset="UTF-8"> | |
<title>List</title> | |
</head> | |
<body> | |
<!-- code here --> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('myApp', []); | |
app.controller('mainCtrl', function(){ | |
// code controller | |
}); |