Hard work by INTERNET

ベンチャーで働くひとりぼっちWEB開発者が頑張るブログ

2016-01-01から1年間の記事一覧

Remove unnecessary check.

github.com issue 本文 railsアプリケーションは、デフォルトでapplictionオブジェクトをセットしている。 だから不要なチェックは削除する。 def root - application && application.config.root + application.config.root end 返信 Not everything that h…

updated_attributeメソッドで 属性が変更されなかったならtrueを返す

github.com issue本文 If the attribute is not changed, then update_attribute does not run SQL query, this effectively means that no change was made to the attribute. 属性が変更されなかったらupdate_attributeメソッドはSQLクエリを実行せず、実…

DateTime#blank? のメソッドをempty?を使うように修正する

github.com issue本文 I think DateTime#blank? should be use Object#blank? method. DateTime#blank? は Object#blank? を使うべきだと思う。 WDYT?(Why do you thihk?) どう思う? 返事 Inheritance is only left to non-whitelisted classes. The method…

ActiveRecord exec_query fail for nonselect requests

github.com 本文 non select クエリーを exec_query#ActiveRecordで実行すると失敗する。 ActiveRecord::Base.connection.exec_query( 'update orders set id=1 where id=1' ) これのようなnon select クエリーを実行。 NoMethodError: undefined method `fi…

restartタスクの中でrailsコマンドを使え

github.com Be consistent in testing outputs from railties test and use /bin/rails by vipulnsward · Pull Request #23212 · rails/rails · GitHub に関連する。