This file contains hidden or 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 TimesheetApprovalWorker | |
include Sidekiq::Worker | |
sidekiq_options queue: :timesheet_notifier, backtrace: true | |
def perform(timesheet_id) | |
@timesheet = Timesheet.includes(:user, :pay_perid, :authoriser) | |
TimesheetMailer.approved(@timesheet).deliver | |
end | |
end |
This file contains hidden or 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
# lib/ldap_authenticable.rb | |
require 'net/ldap' | |
require 'devise/strategies/authenticatable' | |
class Authentication::LdapAuthenticatable < Devise::Strategies::Authenticatable | |
def authenticate! | |
if params[:user] | |
result = Authentication::Ldap.instance.authenticate(email, password) |
This file contains hidden or 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
# config/initializers/ldap.rb | |
# Adding new authentication strategy | |
Warden::Strategies.add(:ldap_authenticatable, Authentication::LdapAuthenticatable) | |
# Loading LDAP configurations | |
ldap_settings = YAML::load_file(Rails.root.join('config', 'ldap.yml')) | |
if ldap_settings[Rails.env].present? | |
Rails.configuration.ldap = OpenStruct.new(ldap_settings[Rails.env]) | |
end |
This file contains hidden or 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
source 'http://rubygems.org' | |
gem 'rails', '~> 3.1.0' | |
gem 'rack', '1.3.3' | |
# Rails extensions | |
gem 'derail', git: 'git://github.com/sj26/derail.git' | |
# PostgreSQL is for winners! |
This file contains hidden or 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
.button | |
@extend .btn | |
@extend .btn-default | |
.main-navigation | |
@extend .navbar-inverse | |
@extend .navbar-static-top |
This file contains hidden or 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
.main-navigation | |
link_to "This is a button", "#", class: "button" |
This file contains hidden or 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
.navbar-inverse.navbar-static-top | |
link_to "This is a button", "#", class: "btn btn-primary" |
This file contains hidden or 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
<body> | |
<nav role="navigation"> | |
<ul> | |
<% Rails.configuration.menu.each do |item| %> | |
<li><%= link_to(item.title, item.url, target: item.target) %> | |
<% end %> | |
</ul> | |
</nav> | |
</body> |
OlderNewer