diff options
-rw-r--r-- | actionpack/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activemodel/CHANGELOG.md | 4 | ||||
-rw-r--r-- | activerecord/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activesupport/CHANGELOG.md | 23 | ||||
-rw-r--r-- | guides/source/4_1_release_notes.md | 357 | ||||
-rw-r--r-- | guides/source/documents.yaml | 5 | ||||
-rw-r--r-- | guides/source/kindle/KINDLE.md | 26 | ||||
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 22 |
8 files changed, 392 insertions, 56 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index e649847990..f52a07eaee 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -130,10 +130,6 @@ *Vasiliy Ermolovich* -* Separate Action View completely from Action Pack. - - *Łukasz Strzałkowski* - * Development mode exceptions are rendered in text format in case of XHR request. *Kir Shatrov* @@ -234,7 +230,7 @@ *Yves Senn*, *Andrew White* -* ActionView extracted from ActionPack. +* Action View extracted from Action Pack. *Piotr Sarnacki*, *Łukasz Strzałkowski* diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index e8602ecbcf..77d1252f1f 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -7,7 +7,7 @@ *William Myers* -* Added new API methods `reset_changes` and `changed_applied` to `ActiveModel::Dirty` +* Added new API methods `reset_changes` and `changes_applied` to `ActiveModel::Dirty` that control changes state. Previsously you needed to update internal instance variables, but now API methods are available. @@ -23,7 +23,7 @@ for non-numerical ones. Fixes range validations like `:a..:f` that used to pass with values like `:be`. - Fixes #10593 + Fixes #10593. *Charles Bergeron* diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 81e48862d4..104e8e3e40 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -23,7 +23,6 @@ *Brian Thomas Storti* - * Fix validation on uniqueness of empty association. *Evgeny Li* @@ -850,7 +849,7 @@ class Author < ActiveRecord::Base has_many :posts - has_many :taggings, :through => :posts + has_many :taggings, through: :posts end class Post < ActiveRecord::Base @@ -865,7 +864,7 @@ class Author < ActiveRecord::Base has_many :posts - has_many :taggings, :through => :posts, :source => :tagging + has_many :taggings, through: :posts, source: :tagging end class Post < ActiveRecord::Base diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 37879760a6..9c7078b9a4 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,15 +1,15 @@ -* Deprecated Numeric#{ago,until,since,from_now}, the user is expected to explicitly - convert the value into an AS::Duration, i.e. 5.ago => 5.seconds.ago +* Deprecated `Numeric#{ago,until,since,from_now}`, the user is expected to explicitly + convert the value into an AS::Duration, i.e. `5.ago` => `5.seconds.ago` This will help to catch subtle bugs like: - def recent?(days = 3) - self.created_at >= days.ago - end + def recent?(days = 3) + self.created_at >= days.ago + end The above code would check if the model is created within the last 3 **seconds**. - In the future, Numeric#{ago,until,since,from_now} should be removed completely, + In the future, `Numeric#{ago,until,since,from_now}` should be removed completely, or throw some sort of errors to indicate there are no implicit conversion from Numeric to AS::Duration. @@ -22,8 +22,7 @@ * Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These methods change current time to the given time or time difference by stubbing `Time.now` and `Date.today` to return the time or date after the difference calculation, or the time or date that got passed into the - method respectively. These methods also accept a block, which will return current time back to - its original state at the end of the block. + method respectively. Example for `#travel`: @@ -178,7 +177,8 @@ *Simon Coffey* -* Add String#remove(pattern) as a short-hand for the common pattern of String#gsub(pattern, '') +* Add `String#remove(pattern)` as a short-hand for the common pattern of + `String#gsub(pattern, '')`. *DHH* @@ -281,11 +281,12 @@ *Carlos Antonio da Silva* -* Remove deprecated `BufferedLogger`. +* Remove deprecated `BufferedLogger`, use `ActiveSupport::Logger` instead. *Yves Senn* -* Remove deprecated `assert_present` and `assert_blank` methods. +* Remove deprecated `assert_present` and `assert_blank` methods, use `assert + object.blank?` and `assert object.present?` instead. *Yves Senn* diff --git a/guides/source/4_1_release_notes.md b/guides/source/4_1_release_notes.md new file mode 100644 index 0000000000..449c279d39 --- /dev/null +++ b/guides/source/4_1_release_notes.md @@ -0,0 +1,357 @@ +Ruby on Rails 4.1 Release Notes +=============================== + +Highlights in Rails 4.1: + +* Action View extracted from Action Pack + +These release notes cover only the major changes. To know about various bug +fixes and changes, please refer to the change logs or check out the +[list of commits](https://github.com/rails/rails/commits/master) in the main +Rails repository on GitHub. + +-------------------------------------------------------------------------------- + +Upgrading to Rails 4.1 +---------------------- + +If you're upgrading an existing application, it's a great idea to have good test +coverage before going in. You should also first upgrade to Rails 4.0 in case you +haven't and make sure your application still runs as expected before attempting +an update to Rails 4.1. A list of things to watch out for when upgrading is +available in the +[Upgrading to Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-4-0-to-rails-4-1) +guide. + + +Major Features +-------------- + + +Documentation +------------- + + +Railties +-------- + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md) +for detailed changes. + +### Removals + +* Removed `update:application_controller` rake task. + +* Removed deprecated `Rails.application.railties.engines`. + +* Removed deprecated threadsafe! from Rails Config. + +* Remove deprecated `ActiveRecord::Generators::ActiveModel#update_attributes` in + favor of `ActiveRecord::Generators::ActiveModel#update` + +* Remove deprecated `config.whiny_nils` option + +* Removed deprecated rake tasks for running tests: `rake test:uncommitted` and + `rake test:recent`. + +### Notable changes + +* `BACKTRACE` environment variable to show unfiltered backtraces for test + failures. ([Commit](https://github.com/rails/rails/commit/84eac5dab8b0fe9ee20b51250e52ad7bfea36553)) + +* Expose MiddlewareStack#unshift to environment configuration. ([Pull Request](https://github.com/rails/rails/pull/12479)) + + +Action Mailer +------------- + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md) +for detailed changes. + +### Notable changes + +* Instrument the generation of Action Mailer messages. The time it takes to + generate a message is written to the log. ([Pull Request](https://github.com/rails/rails/pull/12556)) + + +Active Model +------------ + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/activemodel/CHANGELOG.md) +for detailed changes. + +### Deprecations + +* Deprecate `Validator#setup`. This should be done manually now in the + validator's constructor. ([Commit](https://github.com/rails/rails/commit/7d84c3a2f7ede0e8d04540e9c0640de7378e9b3a)) + +### Notable changes + +* Added new API methods `reset_changes` and `changes_applied` to + `ActiveModel::Dirty` that control changes state. + + +Active Support +-------------- + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/activesupport/CHANGELOG.md) +for detailed changes. + + +### Removals + +* Remove deprecated `String#encoding_aware?` core extensions (`core_ext/string/encoding`). + +* Remove deprecated `Module#local_constant_names` in favor of `Module#local_constants`. + +* Remove deprecated `DateTime.local_offset` in favor of `DateTime.civil_from_fromat`. + +* Remove deprecated `Logger` core extensions (`core_ext/logger.rb`). + +* Remove deprecated `Time#time_with_datetime_fallback`, `Time#utc_time` and + `Time#local_time` in favor of `Time#utc` and `Time#local`. + +* Remove deprecated `Hash#diff` with no replacement. + +* Remove deprecated `Date#to_time_in_current_zone` in favor of `Date#in_time_zone`. + +* Remove deprecated `Proc#bind` with no replacement. + +* Remove deprecated `Array#uniq_by` and `Array#uniq_by!`, use native + `Array#uniq` and `Array#uniq!` instead. + +* Remove deprecated `ActiveSupport::BasicObject`, use + `ActiveSupport::ProxyObject` instead. + +* Remove deprecated `BufferedLogger`, use `ActiveSupport::Logger` instead. + +* Remove deprecated `assert_present` and `assert_blank` methods, use `assert + object.blank?` and `assert object.present?` instead. + +### Deprecations + +* Deprecated `Numeric#{ago,until,since,from_now}`, the user is expected to + explicitly convert the value into an AS::Duration, i.e. `5.ago` => `5.seconds.ago` + ([Pull Request](https://github.com/rails/rails/pull/12389)) + +### Notable changes + +* Add `ActiveSupport::Testing::TimeHelpers#travel` and `#travel_to`. These +methods change current time to the given time or time difference by stubbing +`Time.now` and +`Date.today`. ([Pull Request](https://github.com/rails/rails/pull/12824)) + +* Added `Numeric#in_milliseconds`, like `1.hour.in_milliseconds`, so we can feed + them to JavaScript functions like + `getTime()`. ([Commit](https://github.com/rails/rails/commit/423249504a2b468d7a273cbe6accf4f21cb0e643)) + +* Add `Date#middle_of_day`, `DateTime#middle_of_day` and `Time#middle_of_day` + methods. Also added `midday`, `noon`, `at_midday`, `at_noon` and + `at_middle_of_day` as + aliases. ([Pull Request](https://github.com/rails/rails/pull/10879)) + +* Add `String#remove(pattern)` as a short-hand for the common pattern of + `String#gsub(pattern,'')`. ([Commit](https://github.com/rails/rails/commit/5da23a3f921f0a4a3139495d2779ab0d3bd4cb5f)) + +* Remove 'cow' => 'kine' irregular inflection from default + inflections. ([Commit](https://github.com/rails/rails/commit/c300dca9963bda78b8f358dbcb59cabcdc5e1dc9)) + +Action Pack +----------- + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md) +for detailed changes. + +### Removals + +* Remove deprecated Rails application fallback for integration testing, set + `ActionDispatch.test_app` instead. + +* Remove deprecated `page_cache_extension` config. + +* Remove deprecated constants from Action Controller: + + ActionController::AbstractRequest => ActionDispatch::Request + ActionController::Request => ActionDispatch::Request + ActionController::AbstractResponse => ActionDispatch::Response + ActionController::Response => ActionDispatch::Response + ActionController::Routing => ActionDispatch::Routing + ActionController::Integration => ActionDispatch::Integration + ActionController::IntegrationTest => ActionDispatch::IntegrationTest + +### Notable changes + +* Take a hash with options inside array in + `#url_for`. ([Pull Request](https://github.com/rails/rails/pull/9599)) + +* Add `session#fetch` method fetch behaves similarly to + [Hash#fetch](http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-fetch), + with the exception that the returned value is always saved into the + session. ([Pull Request](https://github.com/rails/rails/pull/12692)) + +* Separate Action View completely from Action + Pack. ([Pull Request](https://github.com/rails/rails/pull/11032)) + + +Active Record +------------- + +Please refer to the +[Changelog](https://github.com/rails/rails/blob/4-1-stable/activerecord/CHANGELOG.md) +for detailed changes. + +### Removals + +* Remove deprecated nil-passing to the following `SchemaCache` methods: + `primary_keys`, `tables`, `columns` and `columns_hash`. + +* Remove deprecated block filter from `ActiveRecord::Migrator#migrate`. + +* Remove deprecated String constructor from `ActiveRecord::Migrator`. + +* Remove deprecated `scope` use without passing a callable object. + +* Remove deprecated `transaction_joinable=` in favor of `begin_transaction` + with `:joinable` option. + +* Remove deprecated `decrement_open_transactions`. + +* Remove deprecated `increment_open_transactions`. + +* Remove deprecated `PostgreSQLAdapter#outside_transaction?` + method. You can use `#transaction_open?` instead. + +* Remove deprecated `ActiveRecord::Fixtures.find_table_name` in favor of + `ActiveRecord::Fixtures.default_fixture_model_name`. + +* Removed deprecated `columns_for_remove` from `SchemaStatements`. + +* Remove deprecated `SchemaStatements#distinct`. + +* Move deprecated `ActiveRecord::TestCase` into the rails test + suite. The class is no longer public and is only used for internal + Rails tests. + +* Removed support for deprecated option `:restrict` for `:dependent` + in associations. + +* Removed support for deprecated `delete_sql` in associations. + +* Removed support for deprecated `insert_sql` in associations. + +* Removed support for deprecated `finder_sql` in associations. + +* Removed support for deprecated `counter_sql` in associations. + +* Removed deprecated method `type_cast_code` from Column. + +* Removed deprecated options `delete_sql` and `insert_sql` from HABTM + association. + +* Removed deprecated options `finder_sql` and `counter_sql` from + collection association. + +* Remove deprecated `ActiveRecord::Base#connection` method. + Make sure to access it via the class. + +* Remove deprecation warning for `auto_explain_threshold_in_seconds`. + +* Remove deprecated `:distinct` option from `Relation#count`. + +* Removed deprecated methods `partial_updates`, `partial_updates?` and + `partial_updates=`. + +* Removed deprecated method `scoped` + +* Removed deprecated method `default_scopes?` + +* Remove implicit join references that were deprecated in 4.0. + +* Remove `activerecord-deprecated_finders` as a dependency + +* Usage of `implicit_readonly` is being removed`. Please use `readonly` method + explicitly to mark records as + `readonly. ([Pull Request](https://github.com/rails/rails/pull/10769)) + +### Deprecations + +* Deprecate `quoted_locking_column` method, which isn't used anywhere. + +* Deprecate the delegation of Array bang methods for associations. + To use them, instead first call `#to_a` on the association to access the + array to be acted + on. ([Pull Request](https://github.com/rails/rails/pull/12129)) + +* Deprecate `ConnectionAdapters::SchemaStatements#distinct`, + as it is no longer used by internals. ([Pull Request](https://github.com/rails/rails/pull/10556)) + +### Notable changes + +* Added `ActiveRecord::Base.to_param` for convenient "pretty" URLs derived from + a model's attribute or + method. ([Pull Request](https://github.com/rails/rails/pull/12891)) + +* Added `ActiveRecord::Base.no_touching`, which allows ignoring touch on + models. ([Pull Request](https://github.com/rails/rails/pull/12772)) + +* Unify boolean type casting for `MysqlAdapter` and `Mysql2Adapter`. + `type_cast` will return `1` for `true` and `0` for `false`. ([Pull Request](https://github.com/rails/rails/pull/12425)) + +* `.unscope` now removes conditions specified in + `default_scope`. ([Commit](https://github.com/rails/rails/commit/94924dc32baf78f13e289172534c2e71c9c8cade)) + +* Added `ActiveRecord::QueryMethods#rewhere` which will overwrite an existing, + named where condition. ([Commit](https://github.com/rails/rails/commit/f950b2699f97749ef706c6939a84dfc85f0b05f2)) + +* Extend `ActiveRecord::Base#cache_key` to take an optional list of timestamp + attributes of which the highest will be used. ([Commit](https://github.com/rails/rails/commit/e94e97ca796c0759d8fcb8f946a3bbc60252d329)) + +* Added `ActiveRecord::Base#enum` for declaring enum attributes where the values + map to integers in the database, but can be queried by + name. ([Commit](https://github.com/rails/rails/commit/db41eb8a6ea88b854bf5cd11070ea4245e1639c5)) + +* Type cast json values on write, so that the value is consistent with reading + from the database. ([Pull Request](https://github.com/rails/rails/pull/12643)) + +* Type cast hstore values on write, so that the value is consistent + with reading from the database. ([Commit](https://github.com/rails/rails/commit/5ac2341fab689344991b2a4817bd2bc8b3edac9d)) + +* Make `next_migration_number` accessible for third party + generators. ([Pull Request](https://github.com/rails/rails/pull/12407)) + +* Calling `update_attributes` will now throw an `ArgumentError` whenever it + gets a `nil` argument. More specifically, it will throw an error if the + argument that it gets passed does not respond to to + `stringify_keys`. ([Pull Request](https://github.com/rails/rails/pull/9860)) + +* `CollectionAssociation#first`/`#last` (e.g. `has_many`) use a `LIMIT`ed + query to fetch results rather than loading the entire + collection. ([Pull Request](https://github.com/rails/rails/pull/12137)) + +* `inspect` on Active Record model classes does not initiate a new + connection. This means that calling `inspect`, when the database is missing, + will no longer raise an exception. ([Pull Request](https://github.com/rails/rails/pull/11014)) + +* Remove column restrictions for `count`, let the database raise if the SQL is + invalid. ([Pull Request](https://github.com/rails/rails/pull/10710)) + +* Rails now automatically detects inverse associations. If you do not set the + `:inverse_of` option on the association, then Active Record will guess the + inverse association based on heuristics. ([Pull Request](https://github.com/rails/rails/pull/10886)) + +* Handle aliased attributes in ActiveRecord::Relation. When using symbol keys, + ActiveRecord will now translate aliased attribute names to the actual column + name used in the database. ([Pull Request](https://github.com/rails/rails/pull/7839)) + +Credits +------- + +See the +[full list of contributors to Rails](http://contributors.rubyonrails.org/) for +the many people who spent many hours making Rails, the stable and robust +framework it is. Kudos to all of them. diff --git a/guides/source/documents.yaml b/guides/source/documents.yaml index 1bf9ff95e1..ae47744e31 100644 --- a/guides/source/documents.yaml +++ b/guides/source/documents.yaml @@ -165,6 +165,11 @@ work_in_progress: true description: This guide helps in upgrading applications to latest Ruby on Rails versions. - + name: Ruby on Rails 4.1 Release Notes + url: 4_1_release_notes.html + work_in_progress: true + description: Release notes for Rails 4.1. + - name: Ruby on Rails 4.0 Release Notes url: 4_0_release_notes.html description: Release notes for Rails 4.0. diff --git a/guides/source/kindle/KINDLE.md b/guides/source/kindle/KINDLE.md deleted file mode 100644 index 8c4fad18aa..0000000000 --- a/guides/source/kindle/KINDLE.md +++ /dev/null @@ -1,26 +0,0 @@ -# Rails Guides on the Kindle - - -## Synopsis - - 1. Obtain `kindlegen` from the link below and put the binary in your path - 2. Run `KINDLE=1 rake generate_guides` to generate the guides and compile the `.mobi` file - 3. Copy `output/kindle/rails_guides.mobi` to your Kindle - -## Resources - - * [Stack Overflow: Kindle Periodical Format](http://stackoverflow.com/questions/5379565/kindle-periodical-format) - * Example Periodical [.ncx](https://gist.github.com/mipearson/808c971ed087b839d462) and [.opf](https://gist.github.com/mipearson/d6349aa8488eca2ee6d0) - * [Kindle Publishing Guidelines](http://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf) - * [KindleGen & Kindle Previewer](http://www.amazon.com/gp/feature.html?ie=UTF8&docId=1000234621) - -## TODO - -### Post release - - * Integrate generated Kindle document into published HTML guides - * Tweak heading styles (most docs use h3/h4/h5, which end up being smaller than the text under it) - * Tweak table styles (smaller text? Many of the tables are unusable on a Kindle in portrait mode) - * Have the HTML/XML TOC 'drill down' into the TOCs of the individual guides - * `.epub` generation. - diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 004d6bd466..ef5f6ac024 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -22,6 +22,19 @@ Rails generally stays close to the latest released Ruby version when it's releas TIP: Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails. Ruby Enterprise Edition has these fixed since the release of 1.8.7-2010.02. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults, so if you want to use 1.9.x, jump straight to 1.9.3 for smooth sailing. +Upgrading from Rails 4.0 to Rails 4.1 +------------------------------------- + +NOTE: This section is a work in progress. + + +Upgrading from Rails 3.2 to Rails 4.0 +------------------------------------- + +If your application is currently on any version of Rails older than 3.2.x, you should upgrade to Rails 3.2 before attempting one to Rails 4.0. + +The following changes are meant for upgrading your application to Rails 4.0. + ### HTTP PATCH Rails 4 now uses `PATCH` as the primary HTTP verb for updates when a RESTful @@ -120,15 +133,6 @@ Ruby libraries yet. Aaron Patterson's [hana](https://github.com/tenderlove/hana) is one such gem, but doesn't have full support for the last few changes in the specification. -Upgrading from Rails 3.2 to Rails 4.0 -------------------------------------- - -NOTE: This section is a work in progress. - -If your application is currently on any version of Rails older than 3.2.x, you should upgrade to Rails 3.2 before attempting one to Rails 4.0. - -The following changes are meant for upgrading your application to Rails 4.0. - ### Gemfile Rails 4.0 removed the `assets` group from Gemfile. You'd need to remove that |