Skip to content

Instantly share code, notes, and snippets.

View BDQ's full-sized avatar
💥

Brian Quinn BDQ

💥
View GitHub Profile
Gems included by the bundle:
* actionmailer (3.2.8)
* actionpack (3.2.8)
* active_utils (1.0.4)
* activemerchant (1.28.0)
* activemodel (3.2.8)
* activerecord (3.2.8)
* activeresource (3.2.8)
* activesupport (3.2.8)
* acts_as_list (0.1.4)
<% if Spraycan::Theme.find(:all, :conditions => {:applies_to => 'Product Listing Image', :name => 'Small'}).first.active? %>
<div class="product-image">
<%= link_to medium_image(product, :itemprop => "image"), product, :itemprop => 'url' %>
</div>
<script>
$(document).ready(function(){
jQuery('.product-image a').nailthumb({fitDirection:'center center', replaceAnimation: null, proportions: 1});
});
</script>
<% elsif Spraycan::Theme.find(:all, :conditions => {:applies_to => 'Product Listing Image', :name => 'Medium'}).first.active? %>
3.1 All credit cards – please add the following parameter:
<input type="hidden" name="payment_methods" value="ACC">
3.2 Local payment options
<input type="hidden" name="payment_methods" value=" OBT,GIR,DID,SFT,ENT,EBT,SO2,IDL,NPY,PLI,PWY,EPY,MZM">
3.3 Wallet option
<input type="hidden" name="payment_methods" value="WLT">
{
order: {
id: 850712674,
number: "R760610137",
item_total: "47.97",
total: "50.37",
state: "complete",
adjustment_total: "2.4",
user_id: 407201487,
created_at: "2012-09-10T13:37:33Z",
{"order":{"id":850712674,"number":"R760610137","item_total":"47.97","total":"50.37","state":"complete","adjustment_total":"2.4","user_id":407201487,"created_at":"2012-09-10T13:37:33Z","updated_at":"2012-09-25T10:57:28Z","completed_at":"2012-09-10T13:37:33Z","payment_total":"0.0","shipment_state":"pending","payment_state":"balance_due","email":"[email protected]","special_instructions":null,"bill_address":{"id":614571630,"firstname":"Santina","lastname":"Quitzon","address1":"5819 Derick Club","address2":"Suite 240","city":"South William","zipcode":"16804","phone":"1-252-515-0619 x9455","company":null,"alternative_phone":null,"country_id":214,"state_id":889445952,"state_name":null,"country":{"id":214,"iso_name":"UNITED STATES","iso":"US","iso3":"USA","name":"United States","numcode":840},"state":{"abbr":"NY","country_id":214,"id":889445952,"name":"New York"}},"ship_address":{"id":269101270,"firstname":"Muhammad","lastname":"Block","address1":"0167 Abdiel Highway","address2":"Suite 200","city":"South Mae
before_create do |job_log|
job_log.loggable_type = "Augury::#{job_log.loggable_type}"
end
ActionView::Template::Error (undefined method `states' for nil:NilClass):
109: </p>
110:
111: <% if Spree::Config[:address_requires_state] %>
112: <p class="field" id="sstate">
113: <% have_states = [email protected]_address.country.states.empty? %>
114: <%= ship_form.label :state, t(:state) %><span class="required">*</span><br><% state_elements = [
115: ship_form.collection_select(:state_id, @order.ship_address.country.states,
/Users/briandquinn/.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree-7df8f8d05580/core/app/views/spree/checkout/_address.html.erb:112:in `block in _c9611975a5f69558aac0f93cee17dc89'
actionpack (3.2.8) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
---
CensusInfo:
CityName:
Country:
County:
CountyNum:
FinanceNumber:
FirmOrRecipient:
GeoLocationInfo:
IntelligentMailBarcodeKey:
@BDQ
BDQ / bash
Created October 26, 2012 08:40
Re-run specs until they fail (handy for random / inconsistent failures).
RET=0;until [[ $RET = 1 ]];do bundle exec rspec; RET="$?";sleep 1;done
@BDQ
BDQ / order_decorator.rb
Created November 9, 2012 17:09
Spree API patches to allow 'checkout'.
#order model decorator
Order.class_eval do
accepts_nested_attributes_for :line_items, :allow_destroy => true
def self.build_from_api(user, params)
order = create
params[:line_items_attributes].each do |line_item|
order.add_variant(Spree::Variant.find(line_item[:variant_id]), line_item[:quantity])
end