aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/CHANGELOG.md28
-rw-r--r--guides/source/5_0_release_notes.md3
-rw-r--r--guides/source/active_record_migrations.md4
3 files changed, 18 insertions, 17 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 35fe27fae2..b2ab5ffcbe 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,22 +1,20 @@
-* Change `ActiveSupport::Duration` creation with numeric methods like `1.week`
- to create durations with more predictable and ISO8601-conformant parts.
+* `ActiveSupport::Duration` supports weeks and hours.
- This is to remove astonishment from getting `3600 seconds` from `1.hour`.
+ [1.hour.inspect, 1.hour.value, 1.hour.parts]
+ # => ["3600 seconds", 3600, [[:seconds, 3600]]] # Before
+ # => ["1 hour", 3600, [[:hours, 1]]] # After
- It should not affect current apps as duration's `value` (number of seconds) remains the same,
- only hash of `parts` (and `inspect` value) is changed and only when it's constructed by calling
- methods on integers. Manual construction of Durations isn't affected.
- Inside the ActiveSupport::Duration itself most operations rely only on number of seconds.
+ [1.week.inspect, 1.week.value, 1.week.parts]
+ # => ["7 days", 604800, [[:days, 7]]] # Before
+ # => ["1 week", 604800, [[:weeks, 1]]] # After
- Before:
-
- [1.hour.inspect, 1.hour.value, 1.hour.parts] # => ["3600 seconds", 3600, [[:seconds, 3600]]]
- [1.week.inspect, 1.week.value, 1.week.parts] # => ["7 days", 604800, [[:days, 7]]]
-
- After:
+ This brings us into closer conformance with ISO8601 and relieves some
+ astonishment about getting `1.hour.inspect # => 3600 seconds`.
- [1.hour.inspect, 1.hour.value, 1.hour.parts] # => ["1 hour", 3600, [[:hours, 1]]]
- [1.week.inspect, 1.week.value, 1.week.parts] # => ["1 week", 604800, [[:weeks, 1]]]
+ Compatibility: The duration's `value` remains the same, so apps using
+ durations are oblivious to the new time periods. Apps, libraries, and
+ plugins that work with the internal `parts` hash will need to broaden
+ their time period handling to cover hours & weeks.
*Andrey Novikov*
diff --git a/guides/source/5_0_release_notes.md b/guides/source/5_0_release_notes.md
index 6351ff57c1..9078e91923 100644
--- a/guides/source/5_0_release_notes.md
+++ b/guides/source/5_0_release_notes.md
@@ -585,6 +585,9 @@ Please refer to the [Changelog][active-record] for detailed changes.
* Added ActiveRecord `#second_to_last` and `#third_to_last` methods.
([Pull Request](https://github.com/rails/rails/pull/23583))
+* Added ability to annotate database objects (tables, columns, indexes)
+ with comments stored in database metadata for PostgreSQL & MySQL.
+ ([Pull Request](https://github.com/rails/rails/pull/22911))
Active Model
------------
diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md
index 2aae35223a..f914122242 100644
--- a/guides/source/active_record_migrations.md
+++ b/guides/source/active_record_migrations.md
@@ -246,7 +246,7 @@ class AddUserRefToProducts < ActiveRecord::Migration[5.0]
end
```
-This migration will create a `user_id` column and appropriate index.
+This migration will create a `user_id` column and appropriate index.
For more `add_reference` options, visit the [API documentation](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_reference).
There is also a generator which will produce join tables if `JoinTable` is part of the name:
@@ -361,7 +361,7 @@ that will be stored in database itself and can be viewed with database administr
tools, such as MySQL Workbench or PgAdmin III. It's highly recommended to specify
comments in migrations for applications with large databases as it helps people
to understand data model and generate documentation.
-Currently only MySQL and PostgreSQL supports comments.
+Currently only the MySQL and PostgreSQL adapters support comments.
### Creating a Join Table