Skip to content

Instantly share code, notes, and snippets.

Yuichiro Kaneko yui-knk

Block or report user

Report or block yui-knk

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 compare_stackprof.rb
# stackprof (0.2.7)
require 'stackprof'
class StackProfTest
def test_raw
profile = :custom, raw: true) do
10.times do

rails adapter * tables * view

rails 4276b214f8a13a38ac7dc4911e90d295a8e40d5a

books is table, ebooks is view

class MigrationA < ActiveRecord::Migration
  def change
    create_table :books, force: true do |t|
yui-knk / where_to_sql.rb
Last active Aug 29, 2015
Rails ActiveRecord where to_sql is changed (maybe broken....)
View where_to_sql.rb
# Rails 4.2.3 with mysql2
[1] pry(main)> User.where("id" => 1).to_sql
=> "SELECT `users`.* FROM `users` WHERE `users`.`id` = 1"
[2] pry(main)> User.where("" => 1).to_sql
=> "SELECT `users`.* FROM `users` WHERE `users`.`id` = 1"
[3] pry(main)> User.where("" => 1).to_sql
=> "SELECT `users`.* FROM `users` WHERE `db`.`` = 1"
# [3] is invalid SQL because `db`.``
View gist:8486919
  • centos6.4

  • pry

  • rvm 1.25.8

  • ruby 1.9.3

[2] pry(main)> class Foo
View gist:8022158


  • windows XP
  • ruby 2.0.0
  • pry 0.9.11 ~

constant Pry::REPL::Readline is undefined through pry_class.rb

    if defined?(Bond) && Readline::VERSION !~ /editline/i
      config.completer = Pry::BondCompleter.start
You can’t perform that action at this time.