This file contains 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 'mysql' | |
class Mysql::Result | |
def encode(value, encoding = "utf-8") | |
String === value ? value.force_encoding(encoding) : value | |
end | |
def each_utf8(&block) | |
each_orig do |row| | |
yield row.map {|col| encode(col) } |
This file contains 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
search.id_does_not_equal(@product.inventory_items.collect(&:size_id) ) if @product && !@product.inventory_items.empty? |
This file contains 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
xml.Cell do | |
xml.Data number_with_precision( product.sales_per_day(product.sales.last.start_date.to_date), :precision => 3 ) unless product.sales.last.nil? rescue 'N/A', 'ss:Type' => 'Number' | |
end |
This file contains 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
## Output Stock transactions | |
id source_id inventory_item_id quantity comment author_id created_at updated_at source_type cause | |
549133 189953 149193 1 55291 "2010-12-16 12:59:23" "2010-12-16 12:59:23" PurchaseItem PURCHASE | |
586203 203443 149193 11 55291 "2010-12-24 10:15:30" "2010-12-24 10:15:30" PurchaseItem PURCHASE | |
586413 195123 149193 10 55291 "2010-12-24 10:15:31" "2010-12-24 10:15:31" PurchaseItem PURCHASE | |
669023 1159453 149193 -1 2943951 "2011-01-13 10:41:42" "2011-01-13 10:41:42" LineItem SALE | |
765663 1286113 149193 -1 1951411 "2011-02-02 15:21:14" "2011-02-02 15:21:14" LineItem SALE | |
850583 1388293 149193 -1 4869271 "2011-03-07 08:08:11" "2011-03-07 08:08:11" LineItem SALE |
This file contains 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
def ship_mondial_relay_orders | |
tracking_numbers = [] | |
Order.transaction do | |
Order.processing.mondial_relay.each do |order| | |
tracking_number = MondialRelay.create_mondial_relais_expedition(order) | |
order.shipments.create( {:tracking_number => tracking_number, :author => @current_user} ) | |
tracking_numbers << tracking_number | |
if order.processing? | |
order.ship_order! | |
begin |
This file contains 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
Showing /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_ab_test.erb where line #1 raised: | |
Vanity::Adapters::ActiveRecordAdapter is not missing constant VanityConversion! | |
Extracted source (around line #1): | |
1: <% score = experiment.score %> | |
2: <table> | |
3: <caption> | |
4: <%= experiment.conclusion(score).join(" ") %></caption> | |
Trace of template inclusion: /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiment.erb, /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_experiments.erb, /Users/dries/.rvm/gems/ruby-1.8.7-p302/gems/vanity-1.5.3/lib/vanity/templates/_report.erb |
This file contains 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
uninitialized constant Vanity::Rails |
This file contains 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
module Vanity | |
module Rails #:nodoc: | |
def self.load! | |
Vanity.playground.load_path = ::Rails.root + Vanity.playground.load_path | |
Vanity.playground.logger ||= ::Rails.logger | |
# Do this at the very end of initialization, allowing you to change | |
# connection adapter, turn collection on/off, etc. | |
::Rails.configuration.after_initialize do | |
Vanity.playground.load! |
This file contains 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
include_recipe "deploy" | |
node[:deploy].each do |application, deploy| | |
deploy = node[:deploy][application] | |
unless application.match(/_stats$/) | |
execute "restart Rails app #{application}" do | |
cwd deploy[:current_path] | |
command node[:scalarium][:rails_stack][:restart_command] | |
action :nothing |
This file contains 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
include_recipe "deploy" | |
node[:deploy].each do |application, deploy| | |
deploy = node[:deploy][application] | |
unless application.match(/_stats$/) | |
execute "restart Rails app #{application}" do | |
cwd deploy[:current_path] | |
command node[:scalarium][:rails_stack][:restart_command] | |
action :nothing |
OlderNewer