2009-04-23から1日間の記事一覧

named_scopeは賢い! しかし・・・・

named_scope を使い少しハマリました ^^); 次のような model を作り class User < ActiveRecord::Base named_scope :male, :conditions => {:sex => 'M'} named_scope :unique_attr, :select => "distinct age,sex" end console で % ./script/console >> Us…

Rails2.3 ではURL中の ; はパラメターの区切りに解釈されるようだ

Rails2.3にポートしたアプリに思わぬバグが発生したので調べたところ、URL中の ; (セミコロン)の解釈が従来と変わったようです。 Rails2.1.2 GET http://localhost/redirects/887308412?a=3;b=2 の場合 Parameters: {"a"=>"3;b=2", "action"=>"show", "id"=>…