My Recent Pastes (34 and counting)

Pastes by robotpoke (34 and counting)

Below are the 15 most recent pasties by robotpoke.

December 05, 2007
1:57PM EDT
by robotpoke

  1) Error:
test_should_not_generate_an_error(QueueEntryTest):
TypeError: wrong argument type nil (expected Data)
    /opt/local/lib/ruby/1.8/yaml.rb:387:in `emit'
    /opt/local/lib/ruby/1.8/yaml.rb:387:in `quick_emit'

December 01, 2007
4:16PM EDT
by robotpoke

    command finished
  * executing `deploy:start'
  * executing `mongrel:cluster:start'
  * executing "sudo -p 'sudo password: ' mongrel_rails cluster::start -C /var/www/apps/rxsuite/current/config/mongrel_cluster.yml"
    servers: ["dev.rxsuite.net"]

November 28, 2007
11:25PM EDT
by robotpoke

##sub model, position

class Position < ActiveRecord::Base
  belongs_to :account
  has_many :users

November 27, 2007
3:32PM EDT
by robotpoke

    def map_attributes(hmap, row)
      hmap.inject({}) do |return_hash, hash_element| 
        attribute = hash_element[0]
        value = hash_element[1]
        if !value["map"].nil? && value["map"].to_s.match(/^\d/) #begins with digit or fk relationship

November 27, 2007
3:23PM EDT
by robotpoke

    #here's the grammar in BNF
    #dyn      ::= <columns>
    #columns  ::= <columns> '+' <column> | <column>
    #column   ::= <numeral> ':' <range> | <numeral>
    #range    ::= <numeral> <range_op> <numeral> | <numeral>

November 16, 2007
2:15AM EDT
by robotpoke

207   def log_entry 
208     @log_entry ||= LogEntry.new({:batch_created_on => exec_time}) 
209   end 
210   def log_entry=(l) 
211     @log_entry = l 

September 24, 2007
2:25PM EDT
by robotpoke

<script type="text/javascript">
//all 3 methods requires standard.js, prototype.js
//toggle visibility of simple/advanced csv_mapping fields
function toggleSimpleAdvanced(integration_column_id) {
  var simple_link = $("csv_link_simple_" + integration_column_id);

September 24, 2007
10:10AM EDT
by robotpoke

    def validate_not_nil_attributes_of_assoc_klass
      begin 
        obj ||= self.assoc_klass.new
        class << obj 
          validates_presence_of :external_id

September 21, 2007
1:16PM EDT
by robotpoke

    def create_integration_columns
      self.assoc_klass.columns.each { |c| integration_columns.build({:column_name => c.name}) }
      integration_columns.each do |ic| 
        ic.is_required = true if required_attribute_names_of_associated_klass.include?(ic.column_name)
        def ic.validate ; end;  #bypass validation for this IntegrationColumn instance

September 21, 2007
11:24AM EDT
by robotpoke

 30   def new
 31     if params[:integration]
 32   debugger
 33       @integration = params[:integration][:type].constantize.new({:is_being_created => true}.merge(params[:integration]))
 34       @integration_file = @integration.build_integration_file({:is_active => true}.merge(params[:integration_file]))

September 21, 2007
11:23AM EDT
by robotpoke

 ActiveRecord::StatementInvalid in IntegrationsController#new

PGError: ERROR:  current transaction is aborted, commands ignored until end of transaction block
: INSERT INTO integration_columns ("default", "integration_id", "csv_map", "column_name", "is_required") VALUES(NULL, NULL, NULL, 'id', NULL)

September 05, 2007
11:26AM EDT
by robotpoke

namespace :utils do
  desc "Process uploaded files"
  task :process_files do
    puts "process uploaded files"
    all_cust_files = CustFile.find :all

August 30, 2007
2:19PM EDT
by robotpoke

#put this in a custom rake file in lib/tasks; you probably want to change the paths and db :)

Rake::Task["db:schema:load"].instance_variable_get(:@actions)[0] = lambda do
  if defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank?
    `psql lms_test < /opt/local/share/postgresql82/contrib/tsearch2.sql`

August 09, 2007
8:51AM EDT
by robotpoke

Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader

Started
E
Finished in 1.716641 seconds.  

August 09, 2007
8:49AM EDT
by robotpoke

Loaded suite /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/rake_test_loader

Started
E
Finished in 1.716641 seconds.  

Next page

Previous page