Skip to content

Instantly share code, notes, and snippets.

child :payments => :payments do
attributes :id, :amount, :state, :payment_method_id
child :payment_method => :payment_method do
attributes :id, :name, :environment
end
end
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
<!DOCTYPE html>
<%= render '/refinery/html_tag' %>
<% site_bar = render('/refinery/site_bar', :head => true) -%>
<%= render '/refinery/head' %>
<body id='<%= canonical_id @page %>'>
<%= site_bar -%>
<%= render '/refinery/ie6check' if request.env['HTTP_USER_AGENT'] =~ /MSIE/ -%>
<div id="page_container">
<header id="header">
<%= render '/refinery/header' -%>
no <down> <Nop>
no <left> <Nop>
no <right> <Nop>
no <up> <Nop>
ino <down> <Nop>
ino <left> <Nop>
ino <right> <Nop>
ino <up> <Nop>
vno <down> <Nop>
vno <left> <Nop>
@GeekOnCoffee
GeekOnCoffee / gist:3053700
Created July 5, 2012 13:38
Spree 0.60 Vulnerability Fix
From 6e07361e1dc08ace0fd38d39067d0d7e3da11e9c Mon Sep 17 00:00:00 2001
From: Ryan Bigg <[email protected]>
Date: Thu, 14 Jun 2012 11:10:01 +1000
Subject: [PATCH] Explicitly define scopes as being searchable This stops
people using class methods or scopes that shouldn't be used
for searching.
Props to joernchen from Phenoelit for informing us about this!
Remove conditions_any scope and use ARel query building instead
From 03c3f527b01951900aa88e2bd3bfd23fc1400f86 Mon Sep 17 00:00:00 2001
From: Ryan Bigg <[email protected]>
Date: Thu, 14 Jun 2012 16:58:53 +1000
Subject: [PATCH] Explicitly define scopes as being searchable This stops
people using class methods or scopes that shouldn't be used
for searching.
Props to joernchen from Phenoelit for informing us about this!
---
app/models/product.rb | 9 +++++++++
@GeekOnCoffee
GeekOnCoffee / gist:2881858
Created June 6, 2012 13:28
Alternative Spree Order Number Generator
Spree::Order.class_eval do
def generate_order_number
self.number = "R#{Time.now.year}#{Time.now.month}#{Time.now.day}#{Array.new(4){rand(9)}.join}" if self.number.blank?
self.number
end
end
Deface::Override.new(:virtual_path => "spree/products/_cart_form",
:name => "example-1",
:replace => ".add-to-cart",
:text => %{ <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
<%= number_field_tag (@product.has_variants? ? :quantity : "variants[#\{@product.master.id\}]"),
1, :class => 'title', :in => [email protected]_hand %>
<%= image_submit_tag("login.png") %>
<% else %>
<%= content_tag('strong', t(:out_of_stock)) %>
<% end %>})
Deface::Override.new(:virtual_path => "spree/products/_cart_form",
:name => "example-1",
:replace => ".add-to-cart",
:text => %{ <% if @product.has_stock? || Spree::Config[:allow_backorders] %>
<%= number_field_tag (@product.has_variants? ? :quantity : "variants[#\{@product.master.id\}]"),
1, :class => 'title', :in => [email protected]_hand %>
<input type="image" src="rainbow.gif" name="image" width="60" height="60">
<% else %>
<%= content_tag('strong', t(:out_of_stock)) %>
<% end %>})