Skip to content

Instantly share code, notes, and snippets.

View jetsgit's full-sized avatar

Jerry Thompson jetsgit

View GitHub Profile
@jetsgit
jetsgit / gist:9789d6e1905fa27bb43f
Created May 16, 2014 17:55
git diff 2-1-stable 2-2-stable core/app/models/spree/adjustment.rb
diff --git a/core/app/models/spree/adjustment.rb b/core/app/models/spree/adjustment.rb
index 35f90f9..c4f7be0 100644
--- a/core/app/models/spree/adjustment.rb
+++ b/core/app/models/spree/adjustment.rb
@@ -1,10 +1,8 @@
# Adjustments represent a change to the +item_total+ of an Order. Each adjustment
# has an +amount+ that can be either positive or negative.
#
-# Adjustments can be open/closed/finalized
-#
Spree::Order.class_eval do
self.state_machine.after_transition :to => :payment, :do => :lookup_tax_cloud, :if => :tax_cloud_eligible?
def lookup_tax_cloud
unless tax_cloud_transaction.nil?
tax_cloud_transaction.lookup
else
create_tax_cloud_transaction
tax_cloud_transaction.lookup
def tax_cloud_adjustment
line_items.each do |line_item|
line_item.adjustments.create({
source: self.tax_cloud_transaction,
label: 'Tax from TaxCloud',
mandatory: true,
eligible: true,
amount: line_item.tax_cloud_cart_item.amount,
order_id: self.id
})
NoMethodError in Spree::CheckoutController#update
undefined method `compute_amount' for #<Spree::TaxCloudTransaction:0x000000092cfe08>
Rails.root: /home/jet/RailsApps/spree/fedtax
Application Trace | Framework Trace | Full Trace
activemodel (4.0.5) lib/active_model/attribute_methods.rb:439:in `method_missing'
activerecord (4.0.5) lib/active_record/attribute_methods.rb:167:in `method_missing'
/home/jet/RailsApps/spree/spree/core/app/models/spree/adjustment.rb:79:in `update!'
activerecord (4.0.5) lib/active_record/relation/delegation.rb:13:in `map'
require_dependency 'spree/calculator'
#
# This is a no-op calculator that just returns the existing value.
# We hook our tax calculations in SpreeAvatax::TaxComputer at the order level instead of here at the line item level
#
module Spree
class Calculator::Avatax < Calculator
class DoNotUseCompute < StandardError; end
@jetsgit
jetsgit / Gemfile
Created January 21, 2012 18:45 — forked from chriseppstein/readme.md
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass', '~> 0.12.alpha'
# include other compass plugins here. E.g.:
gem 'compass-susy-plugin', :require => 'susy'
end
#storeNav
float: left
padding-top: 10px
padding-left: 240px
ul
+horizontal-list(1em)
li
a
font-size: 16px
text-decoration: none
/home/jet/.rvm/gems/ruby-1.9.3-p0@spree-1.2-stable/bundler/gems/spree_flexi_variants-76686d3c763c/app/models/spree/order_decorator.rb:48:in `block in contains?'
activerecord (3.2.8) lib/active_record/associations/collection_proxy.rb:89:in `each'
activerecord (3.2.8) lib/active_record/associations/collection_proxy.rb:89:in `detect'
activerecord (3.2.8) lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
/home/jet/.rvm/gems/ruby-1.9.3-p0@spree-1.2-stable/bundler/gems/spree_flexi_variants-76686d3c763c/app/models/spree/order_decorator.rb:47:in `contains?'
/home/jet/.rvm/gems/ruby-1.9.3-p0@spree-1.2-stable/bundler/gems/spree_flexi_variants-76686d3c763c/app/models/spree/order_decorator.rb:4:in `add_variant'
/home/jet/.rvm/gems/ruby-1.9.3-p0@spree-1.2-stable/bundler/gems/spree-1200d1ab2c0d/core/app/models/spree/order.rb:472:in `block in merge!'
require "bundler/capistrano"
# Below will speed-up deploy by doing a git diff from last deploy
# set :deploy_via, :remote_cache
set :scm, :git
set :repository, "jet@209.166.65.132:aceleathergoods.git"
set :branch, "origin/dev_ruby-1.9.3-p194"
set :migrate_target, :current
set :ssh_options, { :forward_agent => true }
nginx.conf
user deployer staff;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;