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 ImportCropsterDataJobTest < ActiveJob::TestCase | |
test "create blend batches" do | |
@blend = FactoryGirl.create(:great_coffee, :blend => true) | |
@c1 = @blend.blend_coffees.first | |
@c2 = @blend.blend_coffees.last | |
@c1.update_attribute(:cropster_id, 1) | |
@c2.update_attribute(:cropster_id, 2) | |
@lot_id = 1654109 | |
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 WholesaleOrdersController < ApplicationController | |
PERMITTED_PARAMS = [:address_id, :payment_method, :pickup, :shipping_method, :wholesale_order_items_attributes => [:ounces, :quantity, :great_coffee_id]] | |
before_filter :activated_check! | |
before_filter :load_wholesale_order, :only => [:show, :pay, :send_check] | |
before_filter :new_wholesale_order_from_params, :only => [:create, :shipping] | |
skip_before_filter :authenticate_user! | |
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
module Arel::Predications | |
def has_key(right) | |
Arel::Nodes::HasKey.new(self, quoted_node(right)) | |
end | |
end | |
class Arel::Nodes::HasKey < Arel::Nodes::Binary | |
def operator; :"?" 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
module Arel | |
def self.add_predicate(predicate, operator) | |
$method_name = predicate | |
$operator = operator | |
$class_name = $method_name.to_s.camelcase | |
module Arel::Predications | |
define_method($method_name) do |right| |
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 Registration < ActiveRecord::Base | |
scope :nhb_consent_eq, -> (enum = "yes") { | |
where("document @> ?", { nhb_consent: { value: enum } }.to_json ) | |
} | |
private | |
def self.ransackable_scopes(auth_object = nil) | |
%i(nhb_consent_eq) | |
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
ActiveAdmin.setup do |config| | |
# == Site Title | |
# | |
# Set the title that is displayed on the main layout | |
# for each of the active admin pages. | |
# | |
config.site_title = "NWMedTech" | |
# Set the link url for the title. For example, to take | |
# users to your main site. Defaults to no link. |
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
# @order.to_slack_json | |
{ | |
:message => "this is a test" | |
} |
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
find: https://order.dominos.com/power/store-locator?s=${line1}&c=${line2}&type=${type} | |
method: GET | |
s: Street Address | |
c: City, State and/or Postal Code | |
type: Delivery or Carryout | |
store info: https://order.dominos.com/power/store/${storeID}/profile | |
method: GET | |
storeId: store id number |
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
$(document).on('page:load', function(){ | |
$('[ng-app]').each(function(){ | |
angular.bootstrap(this); | |
}); | |
}); |
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
$cat dump.sql | psql nwmedtech_production | |
SET | |
SET | |
SET | |
SET | |
SET | |
SET | |
ERROR: database "callcenter" already exists | |
ERROR: role "nwmedtech" does not exist | |
You are now connected to database "callcenter" as user "gabeodess". |