This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :spree do | |
desc "Export Products to CSV File" | |
task :export_products => :environment do | |
require 'fastercsv' | |
products = Product.find(:all) | |
puts "Exporting to #{RAILS_ROOT}/products.csv" | |
FasterCSV.open("#{RAILS_ROOT}/products.csv", "w") do |csv| | |
csv << ["id", "name", "description","sku", "master_price" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uncomment this if you reference any of your controllers in activate | |
# require_dependency 'application' | |
module CameraFields | |
def add_camera_fields | |
@additional_product_fields += [ | |
{:name => 'Cline Price'}, | |
{:name => 'Cost'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddProductFields < ActiveRecord::Migration | |
def self.up | |
add_column :products, :cline_price, :decimal, :precision => 8, :scale => 2 | |
add_column :products, :cost, :decimal, :precision => 8, :scale => 2 | |
add_column :products, :manufacturers_sku, :string | |
add_column :products, :code, :string | |
add_column :variants, :cline_price, :decimal, :precision => 8, :scale => 2 | |
add_column :variants, :cost, :decimal, :precision => 8, :scale => 2 | |
add_column :variants, :manufacturers_sku, :string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :lightmine do | |
task :export => :environment do | |
project = Project.find_by_name('Spree', :include => {:issues => [:fixed_version, :author]}) | |
versions = [] | |
project.versions.each do |version| | |
version_export = {} | |
version_export.merge! version.attributes.delete_if { |k,v| !%w{id name description}.include? k} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'builder' | |
def add_directory(path, parent, name) | |
parent.dict do |dict| | |
dict.key "name" | |
dict.string name #"#{name} (#{path})" | |
dict.key "regexFolderFilter" | |
dict.string "!.*/(\\.[^/]*|CVS|_darcs|_MTN|\\{arch\\}|blib|.*~\\.nib|.*\\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$" | |
dict.key "sourceDirectory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OrdersController#create (disable protect_from_forgery in BaseController) | |
ab -c 1 -n 5 -p params.txt -T application/x-www-form-urlencoded http://127.0.0.1:3000/orders/ | |
params.txt = variants[429921481]=1 | |
To test the checkout controller, step through checkout until last step in browser and re-user the order number in the ab commands below. First ensure check_roles returns true in role_requirement_system.rb. | |
Address Step | |
ab -c 1 -n 5 http://127.0.0.1:3000/orders/R044784352/checkout/edit?step=address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'diffy' | |
require 'nokogiri' | |
require 'cgi' | |
module Deface | |
class Parser | |
# converts erb to markup | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if Rails.env.development? %> | |
<% DefaceEditor::Theme.active.each do |theme| %> | |
<% theme.stylesheets.each do |stylesheet| %> | |
<style id="<%= stylesheet.name %>"> | |
<%= stylesheet.css %> | |
</style> | |
<% end %> | |
<% theme.javascripts.each do |javascript| %> | |
<script type="text/javascript" id="<%= javascript.id %>"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 4 | |
preload_app true | |
timeout 30 | |
listen 3000 | |
after_fork do |server, worker| | |
ActiveRecord::Base.establish_connection | |
end |
OlderNewer