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
AASM::Event.class_eval do | |
def fire_callbacks_with_logging(*args, &block) | |
fire_callbacks_without_logging(*args, &block) | |
end | |
alias_method_chain :fire_callbacks, :logging | |
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
[color] | |
ui = auto | |
[core] | |
editor = vim | |
autocrlf = false | |
whitespace = space-before-tab,cr-at-eol | |
excludesfile = ~/.gitignore_global | |
trustctime = false | |
mergeoptions = --no-edit | |
[alias] |
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
//Copyright (c) 2013, Petr Prokop | |
//All rights reserved. | |
// | |
//Redistribution and use in source and binary forms, with or without | |
//modification, are permitted provided that the following conditions are met: | |
// | |
//1. Redistributions of source code must retain the above copyright notice, this | |
// list of conditions and the following disclaimer. | |
//2. Redistributions in binary form must reproduce the above copyright notice, | |
// this list of conditions and the following disclaimer in the documentation |
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 MobilePhoneLengthValidator < ActiveModel::Validations::LengthValidator | |
def initialize(*) | |
super | |
@options = options.dup | |
end | |
def validate_each(*) | |
options.merge!(configured_validations) | |
super |
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
AllCops: | |
Exclude: | |
- db/schema.rb | |
- bin/* | |
RunRailsCops: true | |
AbcSize: | |
Enabled: false | |
AccessorMethodName: |
Read the DOCS.
This is easy and straightforward. All you need is to add react-transmit
into dependencies (npm install --save react-transmit
). Transmit works as a Higher-order component so instead of
export default class Dashboard extends PureComponent {
// ...
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
import Promise from 'bluebird' | |
import config from '../config' | |
export default function loadUserState(req, res, next) { | |
const dataSources = [loadMessages(), loadSomeOtherData()] | |
if (config.translationServer.loadTranslations) | |
dataSources.push(loadTranslations()) | |
Promise.settle(dataSources).then(receivedData => { |