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 build_address_lines(record) | |
lines = [] | |
%w{store_name address1 address2 address3}.each do |field| | |
lines << record[field].strip unless record[field].blank? | |
end | |
last_line = '' | |
%w{city state zip country}.each do |field| | |
last_line << ' ' + record[field].strip unless record[field].blank? | |
end | |
lines << last_line unless last_line.blank? |
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
Started POST "/amf" for 127.0.0.1 at 2012-01-12 19:41:28 +0000 | |
DEPRECATION WARNING: ref is deprecated and will be removed from Rails 3.2. (called from get_service at /var/elastic/skillet/shared/bundle/ruby/1.9.1/bundler/gems/rails3-amf-c8e6239f2c3d/lib/rails3-amf/request_processor.rb:59) | |
DEPRECATION WARNING: new is deprecated and will be removed from Rails 3.2. (called from get_service at /var/elastic/skillet/shared/bundle/ruby/1.9.1/bundler/gems/rails3-amf-c8e6239f2c3d/lib/rails3-amf/request_processor.rb:59) | |
DEPRECATION WARNING: get is deprecated and will be removed from Rails 3.2. (called from get_service at /var/elastic/skillet/shared/bundle/ruby/1.9.1/bundler/gems/rails3-amf-c8e6239f2c3d/lib/rails3-amf/request_processor.rb:59) | |
Processing by DocumentsController#create as AMF | |
Parameters: {0=>{"versionCreatedWith"=>"3.1.042", "region"=>"A01", "updatedBy"=>"Elastic", "totalPriceRetail"=>4000, "dateCreated"=>1326397272.86, "totalPriceWholesale"=>2000, "createdBy"=>"Elastic", "dateUpdated"=>1326397299.305, |
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
# encoding: utf-8 | |
module Mongoid #:nodoc: | |
# Include this module to add automatic sequence feature | |
# usage: | |
# Class KlassName | |
# include Mongoid::Document | |
# include Mongoid::Sequence | |
# ... | |
# field :number, :type=>Integer | |
# sequence :number |
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
# Product numbers: | |
Document.skip_callback(:save, :before, :create_fields!) | |
Document.skip_callback(:save, :before, :can_save?) | |
trans = {"CB31" => "AAZZ", "CB32" => "A8WW", "CB35" => "AAZX", "CB36" => "A3EX", "CB34" => "AZFJ"} | |
Document.where(:'pages.page_products.product_number'.in => trans.keys).each do |doc| | |
p "Working on document #{doc.number}" | |
doc.pages.each do |page| | |
p "Page #{page.name}" | |
page.page_products.each do |pp| | |
if trans[pp.product_number] |
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
I am attesting that this GitHub handle timting is linked to the Tezos account tz2JmZ9V4jEndEViNZz4K3ZPk3vv7wp3FrYu for tzprofiles | |
sig:spsig1aztbBEk8TBckSd8Y67sSZBejfhvLE9FZ7C4nfy8cHYfhSvSuh22Lpk1RjxUB8o8bCYS113HRaH3jUbHrby974y3DxvtDs |