Skip to content

Instantly share code, notes, and snippets.

@fukajun
Last active December 11, 2015 11:08
Show Gist options
  • Select an option

  • Save fukajun/4591770 to your computer and use it in GitHub Desktop.

Select an option

Save fukajun/4591770 to your computer and use it in GitHub Desktop.

Railsの変更点

2013-01-22

  • イレギュラーな単数形に対応するための変更 activesupport/lib/active_support/inflector/inflections.rb

2013-01-21

  • update_all, delete_allを default scopeと組み合わせた時に正しく動作しない現象が修正された?
  • buildしたあとのempty?がfalseを返すように変更になった?
    ローカルのバージョンでもそうなってるけどなぁーーー
 widget = Widget.new
 widget.things.build
 widget.things.empty? # => false

  • i18nとかでsymobleに依存しないような書き方になってる?

2013-01-18

  • active_record/relation/predicate_builderの一部処理が変わったけど?これ なんだ? => whereのときにhash渡した時に条件を組立ててる処理みたい。

2013-01-17

  • rake notesを出力するための処理が修正されてた
  • params.reqreuireについてのテストが修正されてた

こんな書き方できるらしい。bookとnameのパラメータがないとエラーになる。

 class BooksController < ActionController::Base
   def create
     params.require(:book).require(:name)
     head :ok
   end
 end
  • mysql2_adapterのconnectionの引数をsymbolize_keysする処理の位置が変わってた。

2013-01-17 part 2

  • date_select.rbのこの変更どういう意味かわからんかった。

3daff0508bd93cfcbe8917e745a28f5a738fcdaa

- datetime = options[:selected] || value(object) || default_datetime(options)
+ datetime = options.fetch(:selected) { value(object) || default_datetime(options) }

2013-01-17 part3

  • rake log:clearの実装が変わっていた。LOGオプションで消すログファイルをしていできるようになっていた。
 desc "Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)"

2013-01-16

  • collection_check_boxesとcollection_radio_buttonsにブロックが渡せるようになって、ラベルとラジオボタンの組み合わせ方の自由度が上がった?
  • date_time_selectのオプションがvalueからselectedに変わってる?
  • routesのconstraintsの値には、integer, string, array, regexも使える。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment