2014/05/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです(詳細は本文参照)。
- pg,
reset_pk_sequence!
respects schemas. Closes #14719. - Fixed #columns_for_distinct of postgresql adapter
- pg,
default_sequence_name
respects schema. Closes #7516. - pg, support default values for enum types. Closes #7814.
bin/setup
スクリプトは便利そうです。まだまだ改善されそうな。
Name#model_name doesn't return a String object
activemodel/lib/active_model/naming.rb
のdocの修正です
model_name
メソッドがStringを返すサンプルになってましたが、実際はmodel_name
はStringを返さないので、model_name.name
に修正しています。
Update url to rake docs [ci skip]
RUNNING_UNIT_TESTS.rdoc
の修正です。
rakeのURLをhttp://docs.seattlerb.org/rake/
を修正しています。
"controllers" should be a valid path name
actionpack/test/dispatch/routing_test.rb
の修正です。
params["controllers"]
の値のチェックをテストを追加しています。
Refactor serialized types to be partially defined as custom properties
ConnectionAdaptersの修正です。
Type::SimpleDelegator::Serialized
クラスを新規に作成して、gserialized typeについてはこちらのクラスで扱うよう修正しています。
Fix broken link in Rails 3.0 release_notes
rails guideのRuby on Rails 3.0 Release Notes
の修正です。
URLの記述に誤りがあって、リンクが壊れてしまったいた箇所を修正しています。3.0とはまた古いな。
Add missing period from 4b802bc [ci skip]
rails guideのRuby on Rails 3.0 Release Notes
の修正です。
上記URLの修正でピリオドが無くなってしまったのを追加しています。
Move type_cast_for_write
behavior over to the serialized type object
ConnectionAdaptersの修正です。
type_cast_for_write
メソッドをType::SimpleDelegator::Serialized
クラスに移動しています。
Don't reference comments that do not exist
activerecord/lib/active_record/attribute_methods/write.rb
の修正です。
不要なコメントの削除。
Generated engines don't include bin/rake, fixes #15409 [ci skip]
rails guideのGetting Started with Engines
の修正です。
bin/rake
をrake
に修正しています。engineの場合、bin/rake
は生成されないんですね。
[ci skip] Include ActiveModel::Model in a class instead of inheriting
activemodel/lib/active_model/naming.rb
のdocの修正です。
- # class Person < ActiveModel::Model + # class Person + # include ActiveModel::Model
継承ではなく、includeする必要があるのが誤っていますね。
pass the parsed parameters through the methods so we don't reparse or
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
各メソッドの引数に解析済みのパラメータを追加し、使いまわすようにしています。
use a parser to extract the group parts from the path
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
pathをパースする処理をactionpack/lib/action_dispatch/journey/nodes/node.rb
に切り出しています。
actionpack/lib/action_dispatch/routing/mapper.rb
の修正済み。
各メソッドの引数を追加して、作成済みのASTを使いまわすようにしています。
disconnect path from the instance
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
インスタンス変数からpath
を削除しています。代わりに、メソッドの引数を追加して、使いまわすようにしています。
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
使用していないWILDCARD_PATH
を削除しています。
actionpack/lib/action_dispatch/journey/router/strexp.rb
の修正です。
ast
メソッドを追加しています。
add an alternate constructor to Strexp that takes a string
actionpack/lib/action_dispatch/journey/router/strexp.rb
の修正です。
インスタンス生成用にself.build
メソッドを追加しています。
astについてもbuild
メソッドの中で行うようにしているので、先ほど追加されたast
メソッドは削除されています。
pass the parsed path from mapper to the Strexp
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
build_path
メソッドの引数にast
を追加しています。
Strexp#names is only used in a test, so rm
actionpack/lib/action_dispatch/journey/router/strexp.rb
の修正です。
Strexp#names
メソッドをテストでしか使用してなかったらしく、削除しています。
Path::Pattern is instantiated internally, so make the contructor require a strexp object
actionpack/lib/action_dispatch/journey/path/pattern.rb
の修正です。
Journey::Router::Strexp
のインスタンスを生成する為のself.from_string
メソッドを追加しています。
no more is_a checks on instantiation
actionpack/lib/action_dispatch/journey/path/pattern.rb
の修正です。
initialize
メソッドで最初に、引数がRouter::Strexp
かどうかチェック行っていたのですが、そのチェック処理を削除しています。
no reason to make a Mapper object if the path is blank
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
add_route
メソッドでpathのチェックを行い、空だった場合、ArgumentError
をraiseするよう修正しています。
Mapping never actually uses @set, so rm
actionpack/lib/action_dispatch/routing/mapper.rb
の修正です。
Mapper
クラスの@set
インスタンス変数使ってないらしく、削除しています。
[ci skip] Document Rails' shifted semver.
rails guideのMaintenance Policy for Ruby on Rails
の修正です。
セマンティックバージョニングについて説明を追加しています。
X.Y.Z
のフォーマットについて、以下のような説明が追加されています。
**Patch `Z`** Only bug fixes, no API changes, no new features. Except as necessary for security fixes or deprecations. **Minor `Y`** New features, may contain API changes (Serve as major versions of Semver). Breaking changes are paired with deprecation notices in patch level release of the last minor version level. **Major `X`** New features, will likely contain API changes. The difference between Rails' minor and major releases is the magnitude of breaking changes, and usually reserved for special occasions.
何となくそうだろうなーと思ってた内容ではあるんですが、名言されてなかったんですね。
pg, PostgreSQL::Name
to hold schema qualified names.
PostgreSQLのConnectionAdapterの修正です。
ActiveRecord::ConnectionAdapters::PostgreSQL::Name
クラスを新設しています。
PostgreSQL::Name
クラスでは、schemaの修飾名を保持しています。
obj = Name.new("public", "articles") assert_equal "public.articles", obj.to_s
バラバラと行われていた処理をクラスに切り出した形ですかね。
pg, reset_pk_sequence!
respects schemas. Closes #14719.
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
reset_pk_sequence!
がschema情報を参照してなくて、エラーになるケースがあるのを修正しています。
ActiveRecord::ConnectionAdapters::PostgreSQL::Name
クラスはこの為か。なるほど。
bin/setup
script to bootstrap applications.
bin/setup
scriptが追加されました。
setup
の中では、
- gem install bundler --conservative"
- bundle install
- bin/rake db:setup
- rm -f log/*
- rm -rf tmp/cache
- touch tmp/restart.txt
が実行されます。割と便利な気が。
:scissors: removed deprecated Numeric#ago
and friends
activesupport/lib/active_support/core_ext/numeric/time.rb
の修正です。
deprecateだったNumeric#ago
が削除されました。
5.ago => 5.seconds.ago 5.until => 5.seconds.until 5.since => 5.seconds.since 5.from_now => 5.seconds.from_now
Numeric#ago
自体知らなかっです。
Merge pull request #11896 from nkondratyev/fix_pg_columns_for_distinct
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
ActiveRecord::Base.connection.columns_for_distinct
メソッドでSQL構文の解析が誤っていたのを修正しています。
- s.gsub(/\s+(ASC|DESC)\s*(NULLS\s+(FIRST|LAST)\s*)?/i, '') + s.gsub(/\s+(?:ASC|DESC)?\s*(?:NULLS\s+(?:FIRST|LAST)\s*)?/i, '')
ASC|DESC
は必須ではないんですね。
pg, default_sequence_name
respects schema. Closes #7516.
activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
の修正です。
default_sequence_name
メソッドがschema情報を参照してなかったバグを修正しています。
pg, support default values for enum types. Closes #7814.
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
の修正です。
PostgreSQLのenum
方でデフォルバリューを指定出来るよう修正しています。
refactor, introduce Type#type_cast_for_schema
to cast for schema.rb
ConnectionAdaptersの修正です。
Type#type_cast_for_schema
のリファクタリングを行っています。
Update Minitest references in Testing Guide
rails guideのA Guide to Testing Rails Applications
の修正です。
test/unit
をminitest
に、MiniTest
をMinitest
にそれぞれ修正しています。
bin/setup uses bundle check || bundle install
to improve performance.
railties/lib/rails/generators/rails/app/templates/bin/setup
の修正です。
- system "bundle install" + system "bundle check || bundle install"
bundle check
を先に実行するよう修正しています。
Change the version schema to reflect how deprecations are handled
rails guideのMaintenance Policy for Ruby on Rails
の修正です。
deprecatiosの扱いについて説明を修正しています。
Merge pull request #15313 from andreychernih/time-with-zone-string-conversion-speed-up
activesupport/lib/active_support/time_with_zone.rb
の修正です。
TimeWithZone#respond_to?
メソッドを追加しています。
Stringからの変換処理時の処理高速化になるそうです。へー。