Skip to content

Instantly share code, notes, and snippets.

View voodoorai2000's full-sized avatar

Raimond Garcia voodoorai2000

View GitHub Profile
@voodoorai2000
voodoorai2000 / stats_controller_spec.rb
Last active March 5, 2018 19:01
Make stats_controller_spec.rb aware of timezones
context 'events present' do
let(:time_1) { DateTime.parse("2015-01-01").in_time_zone }
let(:time_2) { DateTime.parse("2015-01-02").in_time_zone }
let(:time_3) { DateTime.parse("2015-01-03").in_time_zone }
before do
create :ahoy_event, name: 'foo', time: time_1
create :ahoy_event, name: 'foo', time: time_1
create :ahoy_event, name: 'foo', time: time_2
create :ahoy_event, name: 'bar', time: time_1
@voodoorai2000
voodoorai2000 / skipping verification.txt
Last active December 7, 2017 13:27
CONSUL - Skipping census and sms verification
#add this line to `config/application.rb`
config.paths['app/models/concerns'].unshift(Rails.root.join('app', 'models', 'concerns', 'custom'))
#add you custom implementation to `app/models/concerns/custom/verification.rb`, for example:
require_dependency Rails.root.join('app', 'models', 'concerns', 'verification').to_s
module Verification
extend ActiveSupport::Concern
def residence_verified?
#you will need this gem
#http://github.com/balinterdi/i15r
namespace :i18n do
desc "Convert text to i18n keys in all views"
task :text_to_key do
FileList["./app/views/**/*.html.erb"].each do |filename|
system "i15r #{filename}"
end
end