My Recent Pastes (169 and counting)

Pastes by court3nay (169 and counting)

Below are the 15 most recent pasties by court3nay.

August 20, 2007
4:47AM EDT
by court3nay

Index: activerecord/lib/active_record/base.rb
===================================================================
--- activerecord/lib/active_record/base.rb      (revision 7347)
+++ activerecord/lib/active_record/base.rb      (working copy)
@@ -424,13 +424,55 @@

August 20, 2007
4:40AM EDT
by court3nay

      # The Finder class allows you to easily define your own custom find implementations.
      # Simply define this class in your model, and any methods will be available
      # to your #find call.  For example,
      #
      #   class User < ActiveRecord::Base

August 20, 2007
4:31AM EDT
by court3nay

class ActiveRecord::Base
  class << self
      def find(*args)
        options = args.extract_options!
        validate_find_options(options)

August 20, 2007
4:26AM EDT
by court3nay

      def find(*args)
        options = args.extract_options!
        validate_find_options(options)
        set_readonly_option!(options)

August 20, 2007
4:17AM EDT
by court3nay

test_allow_nil_address_set_to_nil(AggregationsTest):
NoMethodError: undefined method `find_from_ids' for #<Class:ActiveRecord::Base>
    ./../lib/active_record/base.rb:460:in `send'
    ./../lib/active_record/base.rb:460:in `from_ids'
    ./../lib/active_record/base.rb:447:in `dispatch'

August 20, 2007
4:11AM EDT
by court3nay

      def find(*args)
        options = args.extract_options!
        validate_find_options(options)
        set_readonly_option!(options)

August 20, 2007
3:35AM EDT
by court3nay

Hi guys, what do you think about this implementation (before I go off and actually make it work).  The plan is to make it easier to write extensions or plugins for find.

The current way:

      def find(*args)

August 16, 2007
11:49PM EDT
by court3nay

class Product < AR::Base

  has_many :categorizations, :foreign_key => 'product_id' do
    def replace_with(params, current_user)
      return if params.nil?

August 13, 2007
2:55PM EDT
by court3nay

                                                                                                                                                                                                                                                            Delivered-To: court3nay@gmail.com
Received: by 10.90.36.7 with SMTP id j7cs192901agj;
        Mon, 13 Aug 2007 01:28:22 -0700 (PDT)
Received: by 10.115.76.1 with SMTP id d1mr2643210wal.1186993702115;
        Mon, 13 Aug 2007 01:28:22 -0700 (PDT)

July 29, 2007
10:01PM EDT
by court3nay

# Denormalize

module Caboose
  module Denormalize
    

July 29, 2007
9:54PM EDT
by court3nay

## user.rb
class User < ActiveRecord::Base
  has_many :tasks

end

July 26, 2007
3:07PM EDT
by court3nay

describe MyHelper, "doing stuff" do
  helper_name :my_helper

  def controller
    @controller

July 20, 2007
1:58AM EDT
by court3nay

class Address < ActiveRecord::Base
  include GeoKit::Geocoders
  
  before_validation_on_save :geolocate

July 19, 2007
7:24PM EDT
by court3nay

## fashion_cart.rb

class FashionCart < Cart

  state :active

July 06, 2007
11:53PM EDT
by court3nay

------=_NextPart_000_0033_01C7BFF7.CF831490
Content-Type: text/plain;
        charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Next page

Previous page