2015/02/03分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Remove unused Column#with_type
activerecord/lib/active_record/connection_adapters/column.rb
の修正です。
使用していないColumn#with_type
メソッドを削除しています。
Rename user_provided_types
to something more meaningful
activerecord/lib/active_record/attributes.rb
の修正です。
user_provided_types
をattributes_to_define_after_schema_loads
に名前を変更しています。
Fix a typo in autoloading doc and note on autoload_paths [ci skip]
rails guideのAutoloading and Reloading Constants
の修正です。
config.autoload_paths
の設定についてのexampleにtypoがあったのを修正しています。
-config.autoload_paths += "#{Rails.root}/lib" +config.autoload_paths << "#{Rails.root}/lib"
Properly lookup the limit for bigint
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
の修正です。
bigint
型を使用していた場合に、integerの最大値以上の値を設定した場合に、値が正しく設定されないバグがあったのを修正しています。
- $1.to_i if sql_type =~ /\((.*)\)/ + case sql_type + when /^bigint/i + 8 + when /\((.*)\)/ + $1.to_i + end
Generate consistent names for foreign keys
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
の修正です。
foreign keyの名前を作成する際、ランダムな値をsuffixに設定していたのを、テーブル名 + カラム名の文字列から生成したハッシュ値に設定するよう修正しています。
+ identifier = "#{table_name}_#{options.fetch(:column)}_fk" + hashed_identifier = Digest::SHA256.hexdigest(identifier).first(10) options.fetch(:name) do - "fk_rails_#{SecureRandom.hex(5)}" + "fk_rails_#{hashed_identifier}"
ランダムだと、マイグレーションを実行する度に名前が変わってしまい、例えばチームで開発している時等に、毎回変わってしまうのは良くないのでは、という事で固定の値になるよう修正したようです。
Person class doesn't contain finder methods, hence usage of Person.find_by is wrong.
activemodel/lib/active_model/dirty.rb
のdocの修正です。
ActiveModel
を使用するexampleで、finderメソッドを定義してない使用していたのを、finderメソッドを使用しないよう修正しています。
Small enhancement for generators
railties/lib/rails/generators.rb
の修正です。
map.flat
していた箇所を、flat_map
を使用するよう修正しています。
Wrap method arguments with parentheses in docs
activemodel/lib/active_model/dirty.rb
のdocの修正です。
ActiveModel
のexampleに、メソッド呼び出し時に()
を使用してない箇所があったので、()
を追加しています。
Change AS::Testing::TimeHelpers#travel_to to also stub DateTime.now
ActiveSupport::Testing::TimeHelpers#travel_to
メソッドが、Time.now
、Date.today
メソッドと同じように、DateTime.now
もstubするよう修正しています。