なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2015/05/13)

2015/05/13分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

activerecord/CHANGELOG.md


[ci skip] Don’t encourage sudo gem install

コンポーネントのREADME.rdocに記載されているgem installの実行例から、sudoを削除しています。

-  % [sudo] gem install actionmailer
+  % gem install actionmailer

殆どのユーザはsudoを使用する必要は無いだろう、との事で削除したようです。


Refactor abstract_mysql_adapter type_to_sql method

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rbリファクタリングです。

type_to_sqlメソッドの中で行っていたbinaryintegertext型のsqlへの変換処理をそれぞれメソッドに切り出しています。


Add more detailed comment about _assign_attribute method [ci skip]

activerecord/lib/active_record/attribute_assignment.rbのdocの修正です。

_assign_attributeメソッドのdocに挙動についての説明を追加しています。


Add full set of MySQL CLI options to support SSL authentication when using db:structure dump and load

activerecord/lib/active_record/tasks/mysql_database_tasks.rbの修正です。

MySQLDatabaseTasks#prepare_command_optionsメソッドのオプション設定処理にバグがありMySQLI cliへ正しくオプションが渡せてなかったバグがあったのを修正しています。

SSL系のオプション(sslcasslcert等)が正しく渡せていなかったようです。


:nodoc: postgresql add_column

activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rbのdocの修正です。

private APIであるadd_columnメソッド:nodoc:を追加しています。


Merge branch 'sti-subclass-from-attributes' of https://github.com/agrobbin/rails into agrobbin-sti-subclass-from-attributes

activerecord/lib/active_record/inheritance.rbの修正です。

demodulizeしたクラス名からSTIインスタンス生成が出来るよう対応しています。

例。

class Company < ActiveRecord::Base
end
class SpecialCo < Company
end

Company.new(type: 'SpecialCo') # => Company::SpecialCo

invalid sti error message contains the full class name.

activerecord/lib/active_record/inheritance.rbの修正です。

subclass_from_attributesメソッドの修正です。STIインスタンス生成に失敗した際に、エラーメッセージに表示するクラス名にnamespaceも表示するよう修正しています。

Namespaced::Company.new(type: 'Firm')
# => Invalid single-table inheritance type: Namespaced::Firm is not a subclass of Namespaced::Company

Merge pull request #20121 from matthewrudy/remove-sanitize-hash

activerecord/lib/active_record/sanitization.rbの修正です。

sanitize_sql_for_conditionsメソッドからsanitize_sql_hash_for_conditionsメソッド呼び出しを削除しています。sanitize_sql_hash_for_conditionsメソッドRemove deprecated sanitize_sql_hash_for_conditions · rails/rails@3a59dd2で既に削除済みの為との事。


Remove not used options argument from ActiveSupport::JSON.decode

activesupport/lib/active_support/json/decoding.rbの修正です。

ActiveSupport::JSON.decodeメソッドの引数から、使用していないoptions引数を削除しています。

Rails 4.0まではdecode処理にMultiJSONを使用しており、MultiJSONに渡す為のoptionsを指定出来たのですが、4.1からはMultiJSONを使用しなくなり、options引数も使用しなくなっていたので、削除したようです。