Skip to content

Instantly share code, notes, and snippets.

View sginkov's full-sized avatar

Siarhei Hinkou sginkov

  • Self-Employed
  • Belarus
View GitHub Profile
# OR support for rails 4
module OrScopes
extend ActiveSupport::Concern
module ClassMethods
# Creates a new scope with with all where clauses joined by "OR"
# Preserves joins but ignores all other query elements.
def or_scopes(scopes, use_joins: true)
joins = []
wheres = []
@sginkov
sginkov / Chef solo usage example(Berkshelf, Vagrant).md
Last active September 27, 2018 20:18
Chef solo usage example(Berkshelf, Vagrant)

Installation steps to use chef scripts

1. Install ruby

2. Added Gemfile with kinfe-solo

source "https://rubygems.org"
gem "knife-solo"
gem "berkshelf"