Highlights in Rails 3.2: Faster Development Mode New Routing Engine Automatic Query Explains Tagged Logging These release notes cover only the major changes. To learn about various bug fixes and changes, please refer to the changelogs or check out the list of commits in the main Rails repository on GitHub. 1 Upgrading to Rails 3.2If you're upgrading an existing application, it's a great idea to ha
2012年10月11日17:39 Ruby Rails3.2から導入されたpluckメソッドのパフォーマンスが素晴らしい件 Rails3.2から新たに追加された新機能としてpluckメソッドというのがあるんですが、 (pluckは引き抜くという意味のようです) これが大変素晴らしいなと感動しました。そもそもこのメソッドは引数としてカラム名を渡すとそのカラムの値が配列で返ります。 User.pluck(:name) # => [sasata299, name1, name2, name3, ...] つまり、User.all.map(&:name)と同じような処理なのですが、素晴らしいのはそのパフォーマンスです。mapを使った場合(selectで絞込みをした場合としてない場合)とpluckを使った場合でパフォーマンスを比較してみましょう。 それぞれの処理を1000回ずつ行って計測してみます。
Rails 3.2.0 から、マルチプロセス環境下(Unicornなど)では、 Rails.logger によるロギングが、以下のように複数のリクエスト同士で「混ざる」ようになってしまいました。 Started GET "/search?q=blip" for 0.0.0.0 at 2012-03-12 02:20:18 -0700 Processing by SiteController#search as / Parameters: {"q"=>"blip"} Started GET "/search?q=2bxen" for 0.0.0.0 at 2012-03-12 02:20:20 -0700 Processing by SiteController#search as / Parameters: {"q"=>"2bxen"} Rendered site/foo.html.erb
こんにちは、ほりいです。風邪が流行っていて体調管理が大変なシーズンですね。 先週 “Rails 3.2.0 がリリースされました”:http://weblog.rubyonrails.org/2012/1/20/rails-3-2-0-faster-dev-mode-routing-explain-queries-tagged-logger-store ね。 Rails を使った Web 開発チームでは 3.2 を使い始めていますが、社内でも結局どう変わるの? という声がありましたので、勉強がてらみんなで “Ruby on Rails 3.2 Release Notes”:http://edgeguides.rubyonrails.org/3_2_release_notes.html を翻訳してみようという試みを行いました。その成果を公開したいと思います。 注意書き: * 1章「Upgra
Happy Friday! It's Rails 3.2 day! The official release announcement mentions a few of the big changes, but I'd like to take a moment to highlight a relatively small change I was responsible for, one that I hope may make your life a little easier. From the ActiveRecord CHANGELOG: Generated association methods are created within a separate module to allow overriding and composition using `super`. Fo
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く