aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | Do not take screenshot if driver does not support screenshotyuuji.yaginuma2017-03-042-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Capybara::RackTest::Driver` does not support taking screenshots. If call `#save_screenshot` on `Capybara::RackTest::Driver` will raise the error. ```ruby Error: UsersTest#test_visiting_the_index: Capybara::NotSupportedByDriverError: Capybara::Driver::Base#save_screenshot ``` To prevent errors, if driver does not support screenshot, do not call it.
* | | | | | | Revert "Add a changelog entry for #28284 [ci skip]"eileencodes2017-03-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 84c1b107b9daab90b3ccf520f0f09752e4eaf425. Reverted #28283 so reverted it's changelog update as well.
* | | | | | | Revert "Merge pull request #28283 from ↵eileencodes2017-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/silence_puma_startup_messages_in_system_test" This reverts commit 0d73f9116ccd3ded23e69d70ff5ed23dd339df5b, reversing changes made to 21ff8a493206cd50558b03975a7eaaaeb6ec7900. We don't want to silence Puma because it's start up messages can be useful (to see threads, port etc). #28109 was instead fixed by not running system tests by defaul with `bin/rails test` in #28286.
* | | | | | | Merge pull request #28286 from robin850/skip-system-tests-by-defaultEileen M. Uchitelle2017-03-056-10/+73
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | Avoid running system tests by default
| * | | | | | Avoid running system tests by defaultRobin Dupret2017-03-056-10/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests may be expansive so let's only allow users to run them through `bin/rails test:system` or by passing a path to the `test` command. The same applies for `bin/rake test`. Refs #28109.
* | | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2017-03-042-2/+2
|\ \ \ \ \ \ \
| * | | | | | | Fix generated query in Retrieving specific data from multiple tables section ↵Vipul A M2017-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | Remove duplicated "does" [ci skip]Ryuta Kamizono2017-02-141-1/+1
| | | | | | | |
* | | | | | | | Don't hide method that's been documented API since Rails 2.1Andrew White2017-03-041-3/+3
| | | | | | | |
* | | | | | | | Merge pull request #28288 from tejasbubane/fix-parameter-missing-docRobin Dupret2017-03-041-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [ci skip] Fix ParameterMissing exception name in docs
| * | | | | | | | [ci skip] Fix ParameterMissing exception name in docsTejas Bubane2017-03-041-1/+1
| | |_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should be `ActionController::ParameterMissing` and not `ActionController::MissingParameter`. Corresponding change was done in guides in https://github.com/rails/rails/pull/9816.
* | | | | | | | Merge pull request #28287 from kamipo/fix_db_schema_loadAndrew White2017-03-043-5/+25
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fix `rake db:schema:load` with subdirectories
| * | | | | | | Fix `rake db:schema:load` with subdirectoriesRyuta Kamizono2017-03-053-5/+25
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related #25174. `db:schema:load` doesn't work with subdirectories like previous `db:migrate:status`. `Migrator.migration_files` should be used in `assume_migrated_upto_version` to fix the issue.
* | | | | | | Fix a wrong pull request reference [ci skip]Robin Dupret2017-03-041-1/+1
| | | | | | |
* | | | | | | Add a changelog entry for #28284 [ci skip]Robin Dupret2017-03-041-0/+6
| |/ / / / / |/| | | | |
* | | | | | Merge pull request #25174 from kamipo-fix_db_migrate_statusAndrew White2017-03-044-24/+75
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Fix `rake db:migrate:status` with subdirectories.
| * | | | | | Fix `rake db:migrate:status` with subdirectoriesRyuta Kamizono2017-03-044-24/+75
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `db:migrate` supports subdirectories and have a test. https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/test/cases/migrator_test.rb#L78-L85 But `db:migrate:status` doesn't work with subdirectories. It is due to `Dir.foreach(path)` is not the same with `Dir["#{path}/**/[0-9]*_*.rb"]`. I extracted `migration_files` and sharing it in the both to fix the issue. And added tests for `db:migrate:status`.
* | | | | | Merge pull request #28283 from ↵Andrew White2017-03-041-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/silence_puma_startup_messages_in_system_test Silence puma startup messages in system test
| * | | | | | Silence puma startup messages in system testyuuji.yaginuma2017-03-041-1/+1
| | |/ / / / | |/| | | | | | | | | | | | | | | | Fixes #28109
* | | | | | [ci skip] Add CHANGELOG entry for #28282Andrew White2017-03-041-0/+10
| | | | | |
* | | | | | Merge pull request #28282 from ↵Andrew White2017-03-042-7/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/dont_share_options_with_with_reference_type_column Don't share `options` with a reference type column
| * | | | | | Don't share `options` with a reference type columnRyuta Kamizono2017-03-042-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sharing `options` causes some unexpected behavior. If `limit: 2` is specified, this means that 2 bytes integer for a reference id column and 2 chars string for a reference type column. Another example, if `unsigned: true` is specified, this means that unsigned integer for a reference id column, but a invalid option for a reference type column. So `options` should not be shared with a reference type column.
* | | | | | | Merge pull request #28284 from y-yagi/fix_system_test_exampleRobin Dupret2017-03-041-7/+9
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Fx system test example [ci skip]
| * | | | | | Fx system test example [ci skip]yuuji.yaginuma2017-03-041-7/+9
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since test suffix is automatically granted, it is not necessary to specify it in generator. Also, updated the generated file to contents actually generated.
* | | | | | Escapes and edits to configuring guide [ci skip] (#28280)Vipul A M2017-03-041-5/+5
| | | | | |
* | | | | | A private method can't be called with `self.`Akira Matsuda2017-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So calling `filename_with_extensions` omitting the second argument like this https://github.com/slim-template/slim-rails/blob/8dbc1fbf859ebfa95b0884a0196a6ad9f0ca9cd5/lib/generators/slim/scaffold/scaffold_generator.rb#L10 causes NoMethodError. fixes #28275
* | | | | | Merge pull request #28265 from 0oneo/association_guideRyuta Kamizono2017-03-041-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | passing unique parameter to belongs_to wrongly
| * | | | | | passing unique parameter to belongs_to wrongly0oneo2017-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | passing `unique` parameter to belongs_to not right,
* | | | | | | Merge pull request #28276 from rails/pkwipAaron Patterson2017-03-033-46/+78
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | Various refactoring to association scopes and joins
| * | | | | | remove unused parametersAaron Patterson2017-03-031-6/+6
| | | | | | |
| * | | | | | `join_keys` no longer needs a class passed to itAaron Patterson2017-03-033-30/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reflections only use their own information to create a `join_keys` object. This means that we can call `join_keys` on a reflection object and have it be context-free.
| * | | | | | refactor so there is only one JoinKeys factory methodAaron Patterson2017-03-031-4/+15
| | | | | | |
| * | | | | | ask reflection for klass join reflectionAaron Patterson2017-03-032-13/+16
| | | | | | |
| * | | | | | Move join scopes on to the reflection objectAaron Patterson2017-03-032-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scopes can only ever be *not* reflection objects when they are passed in to the Reflection constructor. Given this fact, we can eliminate is_a checks and an intermediate array object by just asking the reflection object for join scopes.
* | | | | | | Merge pull request #28272 from rails/add-iso8601-and-rfc3339-parsingAndrew White2017-03-038-0/+398
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Add iso8601 and rfc3339 parsing to timezones
| * | | | | | | Add `rfc3339` aliases to `xmlschema`Andrew White2017-03-035-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For naming consistency when using the RFC 3339 profile of ISO 8601 in applications.
| * | | | | | | Add `Time.rfc3339` parsing methodAndrew White2017-03-033-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Time.xmlschema` and consequently its alias `iso8601` accepts timestamps without a offset in contravention of the RFC 3339 standard. This method enforces that constraint and raises an `ArgumentError` if it doesn't.
| * | | | | | | Add `ActiveSupport::TimeZone.rfc3339` parsing methodAndrew White2017-03-033-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously there was no way to get a RFC 3339 timestamp into a specific timezone without either using `parse` or chaining methods. The new method allows parsing directly into the timezone, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.rfc3339("1999-12-31T14:00:00Z") => Fri, 31 Dec 1999 14:00:00 HST -10:00 This new method has stricter semantics than the current `parse` method and will raise an `ArgumentError` instead of returning nil, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.rfc3339("foobar") ArgumentError: invalid date >> Time.zone.parse("foobar") => nil It will also raise an `ArgumentError` when either the time or offset components are missing, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.rfc3339("1999-12-31") ArgumentError: invalid date >> Time.zone.rfc3339("1999-12-31T14:00:00") ArgumentError: invalid date
| * | | | | | | Add `ActiveSupport::TimeZone.iso8601` parsing methodAndrew White2017-03-033-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously there was no way to get a ISO 8601 timestamp into a specific timezone without either using `parse` or chaining methods. The new method allows parsing directly into the timezone, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.iso8601("1999-12-31T14:00:00Z") => Fri, 31 Dec 1999 14:00:00 HST -10:00 If the timestamp is a ISO 8601 date (YYYY-MM-DD) then the time is set to midnight, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.iso8601("1999-12-31") => Fri, 31 Dec 1999 00:00:00 HST -10:00 This new method has stricter semantics than the current `parse` method and will raise an `ArgumentError` instead of returning nil, e.g: >> Time.zone = "Hawaii" => "Hawaii" >> Time.zone.iso8601("foobar") ArgumentError: invalid date >> Time.zone.parse("foobar") => nil
* | | | | | | | Merge pull request #28271 from dijonkitchen/patch-2Robin Dupret2017-03-031-1/+1
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fix spelling in docs
| * | | | | | | Fix spellingJonathan Chen2017-03-031-1/+1
|/ / / / / / / | | | | | | | | | | | | | | [ci skip]
* / / / / / / Remove unnecessary system test codeeileencodes2017-03-031-13/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that we don't need to require system tests in the railties test helper so we can remove it. If you're using system tests they will be loaded by inheriting from ActionDispatch::SystemTestCase and the routes will be loaded by ActionDispatch::IntegrationTest.
* | | | | | Merge pull request #28267 from rails/rm-node-from-constraintsAaron Patterson2017-03-032-3/+3
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Remove `node` parameter to `join_constraints`
| * | | | | Remove `node` parameter to `join_constraints`Aaron Patterson2017-03-032-3/+3
|/ / / / / | | | | | | | | | | | | | | | | | | | | I don't think we actually need this parameter anymore. Nobody seems to be using it.
* | | | | Fix typo in commentAndrew White2017-03-031-1/+1
| | | | |
* | | | | Merge pull request #28223 from mtsmfm/fix-random-fail-on-system-test-with-ajaxEileen M. Uchitelle2017-03-032-1/+29
|\ \ \ \ \ | | | | | | | | | | | | Fix random failure on system test with ajax
| * | | | | Fix random failure on system test with ajaxFumiaki MATSUSHIMA2017-03-032-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If application has ajax, browser may begin request after rollback. `teardown_fixtures` will be called after `super` on `after_teardown` so we must call `Capybara.reset_sessions!` before `super` https://github.com/rails/rails/blob/b61a56541aecd7ac685d4f19d943177a3f1b465a/activerecord/lib/active_record/fixtures.rb#L857
* | | | | | Merge pull request #28204 from rails/deprecate-implicit-coercion-of-durationsAndrew White2017-03-036-8/+149
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Deprecate implicit coercion of `ActiveSupport::Duration`
| * | | | | Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-026-8/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* | | | | | Merge pull request #28260 from Erol/fix-upgrading-rails-guide-typoArun Agrawal2017-03-031-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix typo in Upgrading Ruby on Rails Guide