I hereby claim:
- I am joekhoobyar on github.
- I am joekhoobyar (https://keybase.io/joekhoobyar) on keybase.
- I have a public key ASAsyVYPCONPYhLCkU8ZFlbu8QYqU27SO0qnUy49N0VeHAo
To claim this, I am signing this object:
class ActiveRecord::Base | |
# Defines a shorthand for declaring raw attributes that are not backed by a database column. | |
# | |
# Equivalent to manually defining getter/setter/query methods that call read/write/query_attribute, | |
# but also supports attribute names with characters that are not allowed in normal method names. | |
# Unlike +attr_accessor+, these attributes should work with +composed_of+, associations, etc. | |
# | |
def self.attribute(*names) | |
names.each do |name| |
require 'date' | |
module DateExtensions | |
WEEKDAYS = { :sunday => 0, :monday => 1, :tuesday => 2, :wednesday => 3, | |
:thursday => 4, :friday => 5, :saturday => 6 } | |
# Returns the first weekday of the month. | |
def first_wday | |
(wday - day + 1) % 7 |
module ActiveRecord | |
module FinderMethods | |
# This simple class acts as a "stand-in" for your association, enabling us to reuse logic | |
# in ::ActiveRecord::Associations::AssociationScope. | |
class ExistingAssociation < Struct.new(:klass, :owner, :reflection) | |
delegate :interpolate, to: :klass | |
def initialize klass, related | |
raise ArgumentError if Hash===related && related.length > 1 |
require 'date' | |
# @see https://gist.github.com/joekhoobyar/9235260 | |
class DateValidator < ActiveModel::EachValidator | |
DEFAULT_FORMAT = '%Y-%m-%d' | |
# For testing against the current date. | |
TESTS = [ :future, :past ] | |
# For comparing against another date. |
require 'delegate' | |
# A suitable base class for defining a model decorator that automatically defines a model_klass | |
# singleton method, on all subclasses, that returns the model's class. | |
# | |
# Caveat: Your subclass name *must* match the following template: <code>"#{model_klass.name}Decorator"</code> | |
# | |
# - Example 1: MyModelDecorator # will decorate MyModel | |
# - Example 2: MyNamespace::MyModelDecorator # will decorate MyNamespace::MyModel | |
# |
provider "aws" { | |
region = "${var.aws_region}" | |
} | |
resource "terraform_remote_state" "mobilecloud" { | |
backend = "s3" | |
config { | |
bucket = "devops-terraform-state" | |
key = "mobilecloud-deploy-${var.environment}" | |
region = "${var.aws_region}" |
I hereby claim:
To claim this, I am signing this object: