Skip to content

Instantly share code, notes, and snippets.

View BDQ's full-sized avatar
💥

Brian Quinn BDQ

💥
View GitHub Profile
before_create do |job_log|
job_log.loggable_type = "Augury::#{job_log.loggable_type}"
end
{"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
{
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",
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">
<% 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? %>
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)
Failures:
1) Spree::Api::V1::ProductsController as a normal user pagination can select the next page of products
Failure/Error: json_response["products"].first.should have_attributes(attributes)
NoMethodError:
undefined method `first' for nil:NilClass
# ./spec/controllers/spree/api/v1/products_controller_spec.rb:36:in `block (4 levels) in <module:Spree>'
Finished in 10.91 seconds
108 examples, 1 failure
Spree::Activator
event_names
event_names
Failures:
1) Spree::Activator event_names
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
@BDQ
BDQ / gist:3164364
Created July 23, 2012 15:55
Create Spree::Promotion for free shipping via console.
p = Spree::Promotion.create(event_name: "spree.checkout.coupon_code_added", name: "Free Shipping", code: "FREESHIPBD")
p.promotion_actions << Spree::Promotion::Actions::CreateAdjustment.create()
pa = p.promotion_actions.first
pa.calculator = Spree::Calculator::FreeShipping.new
@BDQ
BDQ / gist:3016726
Created June 29, 2012 08:49
Example of editing existing State Machine
# Adding a new state
Order.state_machine.states << skrill_state = StateMachine::State.new(Order.state_machine, 'skrill')
# Redefining an event
Order.state_machine.events << next_event = StateMachine::Event.new(Order.state_machine, :next)
next_event.transition :from => 'cart', :to => 'address'
next_event.transition :from => 'address', :to => 'delivery'
next_event.transition :from => 'delivery', :to => 'payment', :if => :payment_required?
next_event.transition :from => 'payment', :to => 'skrill', :if => lambda {true}
next_event.transition :from => 'skrill', :to => 'complete'