Skip to content

Instantly share code, notes, and snippets.

View jetsgit's full-sized avatar

Jerry Thompson jetsgit

View GitHub Profile
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
angular.module('jewelsStore')
.controller('JewelsCtrl', [ "JewelsResource", (JewelsResource) ->
this.jewels = JewelsResource.getAll()
console.log this.jewels
])
angular.module('jewelsStore')
.factory('JewelsResource', ['Restangular', (Restangular) ->
getAll: ->
Restangular.all('jewels').getList().$object
<<%= @element_name %>>
<%- @contents.each do |content| -%>
<%- if content['essence_type'] == 'EssenceRichtext' -%>
<div ng-bind-html= "safe(ingredient('<%= content['name'] %>').value)" class="<%= content['name'] %>"></div>
<%- elsif content['essence_type'] == 'EssencePicture' -%>
<img ng-if="ingredient('<%= content['name'] %>') != ''" ng-src="{{ingredient('<%= content['name'] %>').value}}">
<%- else -%>
<div class="<%= content['name'] %>">{{ingredient('<%= content['name'] %>').value}}</div>
<%- end -%>
<%- end -%>
<teaser>
<div class="title">{{ingredient('title').value}}</div>
<div class="body">{{ingredient('body').value}}</div>
</teaser>
Started GET "/admin/signup" for ::1 at 2017-07-06 11:33:16 -0700
ActiveRecord::SchemaMigration Load (2.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by Alchemy::Admin::UsersController#signup as HTML
Alchemy::Site Load (24.7ms) SELECT "alchemy_sites".* FROM "alchemy_sites" WHERE "alchemy_sites"."id" = $1 LIMIT 1 [["id", 1]]
Alchemy::Language Load (29.0ms) SELECT "alchemy_languages".* FROM "alchemy_languages" WHERE "alchemy_languages"."site_id" = $1 AND "alchemy_languages"."id" = $2 LIMIT 1 [["site_id", 1], ["id", 1]]
(31.1ms) SELECT COUNT(*) FROM "alchemy_users"
CACHE (0.0ms) SELECT COUNT(*) FROM "alchemy_users"
Redirected to http://localhost:3000/admin/dashboard
Completed 302 Found in 426ms (ActiveRecord: 105.0ms)