Skip to content

Instantly share code, notes, and snippets.

View ralfting's full-sized avatar
🏠
Working from home

Ralph Effting ralfting

🏠
Working from home
  • Finbits
  • Palhoça - SC
View GitHub Profile
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
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
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.
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
Company Load (0.1ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`email` = 'dinam@dinam.com.br' ORDER BY `companies`.`id` ASC LIMIT 1
Started GET "/" for 127.0.0.1 at 2015-03-25 14:30:24 -0300
ActiveRecord::SchemaMigration Load (0.1ms) 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
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
@ralfting
ralfting / gist:98db2afe7a94c5001975
Created March 26, 2015 01:41
companier_controller.rb
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')
<!DOCTYPE html>
<html lang="en" ng-app>
<head>
<meta charset="UTF-8">
<title>List</title>
</head>
<body>
<!-- code here -->
@ralfting
ralfting / gist:cb45d3dec2a1891b9e07
Last active August 29, 2015 14:17
Controller.js
var app = angular.module('myApp', []);
app.controller('mainCtrl', function(){
// code controller
});