Skip to content

Instantly share code, notes, and snippets.

Hugh Davenport hughdavenport

Block or report user

Report or block hughdavenport

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hughdavenport on github.
  • I am hughdavenport (https://keybase.io/hughdavenport) on keybase.
  • I have a public key whose fingerprint is 470C 59DB F579 68C1 A6D1 45BA 1809 868B 7512 9BA9

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am hughdavenport on github.
  • I am hughdavenport (https://keybase.io/hughdavenport) on keybase.
  • I have a public key whose fingerprint is 7BDB 20C1 883A 0DDC 9D78 7825 D502 2257 A9C4 7E3D

To claim this, I am signing this object:

View gist:5545117
diff --git a/activesupport/lib/active_support/core_ext/object/to_param.rb b/activesupport/lib/active_support/core_ext/object/to_param.rb
index 0d5f350..f25c3d6 100644
--- a/activesupport/lib/active_support/core_ext/object/to_param.rb
+++ b/activesupport/lib/active_support/core_ext/object/to_param.rb
@@ -53,6 +53,6 @@ class Hash
def to_param(namespace = nil)
collect do |key, value|
value.to_query(namespace ? "#{namespace}[#{key}]" : key)
- end.sort * '&'
+ end * '&'
View gist:5025337
--- default_scope.no_time.out 2013-02-25 08:59:20.181150341 +1300
+++ no_scope.no_time.out 2013-02-25 08:59:26.893130014 +1300
@@ -14,15 +14,12 @@
D, DEBUG -- : SQL INSERT INTO "t2s" ("t1_id") VALUES (?) [["t1_id", 2]]
D, DEBUG -- : commit transaction
D, DEBUG -- : T1 Load SELECT "t1s".* FROM "t1s" WHERE "t1s"."flag" = 't'
-D, DEBUG -- : T2 Load SELECT "t2s".* FROM "t2s"
-D, DEBUG -- : T1 Load SELECT "t1s".* FROM "t1s" WHERE "t1s"."flag" = 't' AND "t1s"."id" IN (1, 2)
-D, DEBUG -- : T2 Load SELECT "t2s".* FROM "t2s" INNER JOIN "t1s" ON "t1s"."id" = "t2s"."t1_id"
-D, DEBUG -- : T1 Load SELECT "t1s".* FROM "t1s" WHERE "t1s"."flag" = 't' AND "t1s"."id" = 1 LIMIT 1
View gist:5025300
--- default_scope.rb 2013-02-15 15:25:03.884271576 +1300
+++ no_scope.rb 2013-02-25 08:50:18.150799882 +1300
@@ -21,7 +21,6 @@
end
class T1 < ActiveRecord::Base
- default_scope where(:flag => true)
has_many :t2
attr_accessor :active
end
View gist:4958157
gem 'activerecord'
require 'active_record'
require 'logger'
puts "Active Record #{ActiveRecord::VERSION::STRING}"
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
)
You can’t perform that action at this time.