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
# 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
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
1.8.7 :002 > u = User.last | |
=> #<User id: 8, email: "[email protected]", encrypted_password: "$2a$10$7OJ1p9E/WgbTjY0XW9jULOBpuxAPIM8EnQ/Wk5.rG.0R...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil, created_at: "2013-11-19 07:22:56", updated_at: "2013-11-19 07:22:56", uuid: nil, api_token: nil, account_id: nil, role: 0> | |
1.8.7 :003 > u.send_reset_password_instructions | |
ActionView::Template::Error: ActionView::Template::Error | |
from /usr/local/rvm/gems/ree-1.8.7-2011.02@gimme/gems/activesupport-3.0.19/lib/active_support/core_ext/hash/reverse_merge.rb:18:in `reverse_merge' | |
from /usr/local/rvm/gems/ree-1.8.7-2011.02@gimme/gems/actionpack-3.0.19/lib/action_dispatch/routing/url_for.rb:131:in `url_for' | |
from /usr/local/rvm/gems/ree-1.8.7-2011.02@gimme/gems/actionpack-3.0.19/lib/action_view/helpers/url_helper.rb:99:in `url_for' | |
from /usr/local/rvm/gems/ree-1.8.7-2011.0 |
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
require 'spec_helper' | |
feature 'Existing users can sign in to the site' do | |
let(:user) { FactoryGirl.create :user } | |
background do | |
visit root_path | |
click_link 'Sign in' | |
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
class Registered::Staff::Profile::SkillsController < Registered::Staff::ProfileController | |
def new | |
@available_positions = Position.order_by_name | |
@form = StaffProfileSkillsForm.from_user(current_user) | |
end | |
def create | |
@available_positions = Position.order_by_name |
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
stupid_voices = [ | |
'Agnes', | |
'Albert', | |
'Alex', | |
'Bad News', | |
'Bahh', | |
'Bells', | |
'Boing', | |
'Bruce', | |
'Bubbles', |
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
stupid_song = [ | |
"I threw a wish in the well", | |
"Don't ask me, I'll never tell", | |
"I looked to you as it fell", | |
"And now you're in my way", | |
"I trade my soul for a wish", | |
"Pennies and dimes for a kiss", | |
"I wasn't looking for this", | |
"But now you're in my way", |
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
Viniciuss-MacBook-Pro:ndri-poster_maker_mobile osiro$ rake build:ios ENV=staging | |
WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.9.1 | |
/Users/osiro/Workspace/ndri-poster_maker_mobile/build/ios/www/index.html | |
Warning. Error encountered while saving cache ./.sass-cache/91d2099510d82e7905b3da810461ac68e3a3d819/mixins.css.sassc: can't dump anonymous class #<Class:0x007ffbc678dc68> | |
Warning. Error encountered while saving cache ./.sass-cache/91d2099510d82e7905b3da810461ac68e3a3d819/mixins.css.sassc: can't dump anonymous class #<Class:0x007ffbc678dc68> | |
/Users/osiro/Workspace/ndri-poster_maker_mobile/build/ios/www/poster_pdf.html | |
2013-09-20 14:36:25.534 xcodebuild[63453:4107] warning: ignoring unknown attribute assignment opcode 'b' for entry <C:'CodeSign /Users/osiro/Library/Developer/Xcode/DerivedData/PosterMaker-cjmedqapejjdvyalyjqudihktxmf/Build/Products/Debug-iphoneos/PosterMaker.app'> | |
2013-09-20 14:36:25.535 xcodebuild[63453:4107] warning: ignoring unknown attribute assignme |
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
- current_url = url_for(params.slice(:search)) | |
%h1= page_title | |
= semantic_form_for(@search_form, url: url_for(), method: :get, html: {class: 'inline-form'}) do |f| | |
= f.inputs do | |
= f.input :term | |
= f.input :released_after, as: :date_picker | |
= f.input :released_before, as: :date_picker | |
= f.actions do |