Skip to content

Instantly share code, notes, and snippets.

@djkz
djkz / hello
Created November 26, 2020 23:49
Created from Remix Form!
there
@djkz
djkz / hello there
Created November 26, 2020 23:47
Created from Remix Form!
nice to C u
@djkz
djkz / test gist
Created November 26, 2020 23:45
Created from Remix Form!
this is a test
class Entities.Tasks extends Backbone.Collection
model: Entities.Task
url: -> "/project/#{@project_id}/tasks.json"
constructor: (options) ->
@project_id = options.project_id
super
project_tasks = new Entities.Tasks {project_id:project.id}
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
# Forces all threads to share the same connection. This works on
$(function() {
$( "#draggable" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Dropped!" );
}
});
require 'spec_helper'
describe "ShipmentsCalculator" do
context "shows the right amount for each shipment", :js => true do
before do
reset_spree_preferences do |config|
config.allow_backorders = true
end
@djkz
djkz / gist:2393780
Created April 15, 2012 16:43
Spree 1.1 error on price sort
ActiveRecord::StatementInvalid in Spree/admin/products#index
Showing /home/tima/.rvm/gems/ruby-1.9.2-p290/gems/spree_core-1.1.0.rc1/app/views/spree/admin/products/index.html.erb where line #23 raised:
PG::Error: ERROR: column "spree_variants.price" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...updated_at, spree_products.count_on_hand ORDER BY "spree_var...
^
: SELECT "spree_products".* FROM "spree_products" LEFT OUTER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants".is_master = 't' AND "spree_variants".deleted_at IS NULL WHERE "spree_products"."deleted_at" IS NULL GROUP BY spree_products.id, spree_products.name, spree_products.description, spree_products.available_on, spree_products.deleted_at, spree_products.permalink, spree_products.meta_description, spree_products.meta_keywords, spree_products.tax_category_id, spree_products.shipping_category_id, spree_prod