Skip to content

Instantly share code, notes, and snippets.

View Lordnibbler's full-sized avatar

Ben Radler Lordnibbler

View GitHub Profile
child :shipments => :shipments do
extends "spree/api/shipments/show"
child :shipping_method => :shipping_method do
attributes :name, :zone_id, :shipping_category_id
end
end
class ConvertLoginInstructionFromHtmlToMarkdownInBrands < ActiveRecord::Migration
def self.up
Brand.find_each do |brand|
brand.login_instruction = ReverseMarkdown.parse(brand.login_instruction)
brand.save
end
end
def self.down
renderer = Redcarpet::Render::HTML.new(:filter_html => true)
# we need to protect against multiple includes of the Rails environment (trust me)
require './config/environment' if !defined?(Rails) || !Rails.initialized?
require 'sprockets'
require 'sprockets-helpers'
require "sprockets-sass"
require "sass"
unless Rails.env.production?
map '/assets' do
sprockets = Sprockets::Environment.new
<ul class="btn-toolbar pull-right nav">
<div class="btn-group" id="balls1">
<li class="dropdown" id="balls">
<a class="btn" id="more-actions">
More Actions
<b class="icon-ol arrow-down small dark pull-right"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/users/upload">Import Users</a></li>
<li><a href="#" id="bulk-operations">Bulk Operations</a></li>
Failures:
1) Spree::Product product instance #duplicate duplicates product
Failure/Error: clone = product.duplicate
NoMethodError:
undefined method `[]' for nil:NilClass
# /usr/local/var/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e265e97fce6f/core/lib/spree/core/permalinks.rb:58:in `block (2 levels) in save_permalink'
# /usr/local/var/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/rails-b768647aa89b/activerecord/lib/active_record/relation/delegation.rb:6:in `map'
# /usr/local/var/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/rails-b768647aa89b/activerecord/lib/active_record/relation/delegation.rb:6:in `map'
# /usr/local/var/rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/spree-e265e97fce6f/core/lib/spree/core/permalinks.rb:58:in `block in save_permalink'
Spree::HomeController.class_eval do
def index
# Spree::Taxonomy.all => []
@my_taxons = Spree::Taxonomy.where(name: "Collections").first.taxons.order(:position)
@searcher = Spree::Config.searcher_class.new(params)
@searcher.current_user = try_spree_current_user
@searcher.current_currency = current_currency
@products = @searcher.retrieve_products
<div class="container">
<div class="row">
<div class="span6">
<% if @sent %>
<h2 class="legend">Email Sent!</h2>
<p class='alert-success-more'>We reply within 2-5 business days via email. Please be patient, sometimes we have to sleep!</p>
<% else %>
<h2 class="legend">Email Us</h2>
<%#= simple_form_for @message, :validate => true, :html => { :class => "form-vertical" } do |f| %>
<%#= f.input :name %>
1) Spree::Product product instance #duplicate duplicates product
Spree::Product product instance #duplicate duplicates product
Failure/Error: clone = product.duplicate
NoMethodError:
undefined method `[]' for nil:NilClass
# ./spec/models/spree/product_spec.rb:22:in `block (4 levels) in <top (required)>'
/Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/activesupport/lib/active_support/dependencies.rb:317:in `rescue in depend_on': Missing helper file helpe
rs/spree/analytics_helper.rb (LoadError)
from /Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/activesupport/lib/active_support/dependencies.rb:312:in `depend_on'
from /Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/activesupport/lib/active_support/dependencies.rb:225:in `require_dependency'
from /Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/actionpack/lib/abstract_controller/helpers.rb:135:in `block in modules_for_helpers'
from /Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/actionpack/lib/abstract_controller/helpers.rb:131:in `map!'
from /Users/meowingtons/.rvm/gems/ruby-1.9.3-p429/bundler/gems/rails-f42e0fd3f4d3/actionpack/lib/abstract_controller/helpers.rb:131:in `modules_
# Adds a new item to the order (creating a new order if none already exists)
def populate
ap "#populate"
ap request
# clear cart for buy now action if necessary
ap params
ap @current_order if @current_order
@current_order.line_items.destroy_all if @current_order && (params[:order] and params[:order][:buy_now])
# populate an order