27 May '15, 2pm

Rails Quick Tip: Easy ActiveRecord Optimizations.

Note, email validator was updated to screen name validator. User.where(email: emails).empty? would be enough to check if emails already existed. Thanks to Pavel for pointing this out. And even in the example of a screen name validator, the query could be User.where(screen_name: screen_names).empty? I tried to pull a small piece of code from a large application, and simplify it. Unfortunately, somethings get lost in translation. So my hope is that you take away some simple rules, that can improve your application. Of course if you are doing this in your own app, please write some bench mark tests, import production data, and ensure that you are actually optimizing your code.

Full article: http://hashrocket.com/blog/posts/rails-quick-tips-easy-ac...

Tweets

7 tips from veteran streakers for a successful ...

runnersworld.com 26 May '15, 7am

Maintain your fitness for the fall racing season (and give yourself an excuse to indulge a bit during the summer) by commi...

Need to put conditions on that table you're doi...

api.rubyonrails.org 28 May '15, 7pm

Specify relationships to be included in the result set. For example: users = User.includes(:address) users.each do |user| ...

7 tips from veteran streakers for a successful ...

runnersworld.com 25 May '15, 4pm

Maintain your fitness for the fall racing season (and give yourself an excuse to indulge a bit during the summer) by commi...

Ruby - [Rails]modelファイルを全部まとめてdestroy - Qiita

qiita.com 30 May '15, 1am

## やりたいこと(困っていること) (あんまり無いけど)途中まで作ったRailsアプリのModelを全部削除して、最初から作り直したいことがあった。 そのときのモデル数は15個くらいあって、モデル名をひとつひとつ入力しては削除するのがめんどく...