Commit Graph

61899 Commits

Author SHA1 Message Date
Rafael Mendonça França
5c0d00072d
Update the maintenance policy [ci skip] 2017-03-20 15:04:57 -04:00
Kasper Timm Hansen
8ff7ca5d11 Default to yielding a form variable.
More intention revealing and means `f` can go F itself 😋
2017-03-20 19:57:56 +01:00
Kasper Timm Hansen
8534d2e179 Merge pull request #28406 from chukitow/feature/user-form-with-instead-of-form-for-scaffold
user form with instead of form for in scaffold generator
2017-03-20 19:49:00 +01:00
Kasper Timm Hansen
dd40c77053 Merge pull request #28474 from kamipo/fix_extension_with_darty_target
Fix extension method with dirty target in has_many associations
2017-03-20 19:32:07 +01:00
Rafael França
eeb8c3c246 Merge pull request #28487 from kamipo/remove_duplicated_columns_definition
Remove duplicated `columns` definition
2017-03-20 14:21:04 -04:00
Rafael Mendonça França
fee4257f8d
Fix the blog post template header 2017-03-20 14:08:09 -04:00
Rafael França
2dfe8f1f84 Merge pull request #28486 from y-yagi/add_app_update_for_rails_engine
Add `app:update` task to engines
2017-03-20 13:25:27 -04:00
Rafael França
30fd30e7ec Merge pull request #28473 from kamipo/delegate_uniq_to_records
Delegate `uniq` to `records`
2017-03-20 11:50:18 -04:00
Rafael França
d4c3db0d27 Merge pull request #27939 from kamipo/fix_select_all_with_legacy_binds
Fix `select_all` with legacy `binds`
2017-03-20 11:47:24 -04:00
Ryuta Kamizono
fdc3e789b5 Remove duplicated columns definition 2017-03-20 20:27:02 +09:00
Ryuta Kamizono
1385a8b5ff Fix extension method with dirty target in has_many associations
Extension methods should not delegate to `scope` to respect dirty
target on `CollectionProxy`.

Fixes #28419.
2017-03-20 18:49:14 +09:00
yuuji.yaginuma
a42351acbc Add app:update task to engines
Occasionally we update the file generated by engine.
Therefore, I think that there is a task for updating as well as
application in the engine, it is convenient for updating.
2017-03-20 15:37:45 +09:00
Kasper Timm Hansen
1835d87fb8 Merge pull request #28481 from y-yagi/fix_warning
Fix `warning: character class has duplicated range`
2017-03-20 07:18:19 +01:00
Kasper Timm Hansen
95911db192 Merge pull request #28479 from kamipo/evaluate_default_block_only_when_necessary
Evaluate the default block only when necessary
2017-03-20 07:16:28 +01:00
Richard Schneeman
1934e93d2b Merge pull request #28482 from y-yagi/fix_changelog_entry_about_transaction_error_classes
Fix changelog entry about transaction error classes [ci skip]
2017-03-19 18:06:49 -05:00
yuuji.yaginuma
91377c5b36 Fix changelog entry about transaction error classes [ci skip]
`ActiveRecord::TransactionSerializationError` was introduces in #25093.
However, refactored in #25107, `TransactionSerializationError` is gone.
2017-03-20 07:45:15 +09:00
yuuji.yaginuma
6dfe25a86c Fix warning: character class has duplicated range
This fixes the following warnings:

```
railties/test/generators/encrypted_secrets_generator_test.rb:15: warning: character class has duplicated range: /[\w\d]+/
railties/test/generators/encrypted_secrets_generator_test.rb:18: warning: character class has duplicated range: /production:\n#  external_api_key: [\w\d]+/
railties/test/generators/encrypted_secrets_generator_test.rb:19: warning: character class has duplicated range: /production:\n#  external_api_key: [\w\d]+/
```
2017-03-20 07:31:50 +09:00
Matthew Draper
782f4e2af8 Merge pull request #28475 from y-yagi/correctly_check_whether_key_is_defined
Correctly check whether key is defined in configuration
2017-03-20 05:10:26 +10:30
Ryuta Kamizono
4c1d22183c Evaluate the default block only when necessary
Follow up of #28453.
2017-03-20 00:18:37 +09:00
Jon Moss
8a808d5ca0 Merge pull request #28477 from spdawson/patch-3
Remove stray back-end from ActiveJob Basics guide
2017-03-19 10:34:54 -04:00
Jon Moss
ecab515b2f Merge pull request #28476 from spdawson/patch-2
Minor grammar fixes for Rails 5.1 release notes
2017-03-19 10:34:19 -04:00
yuuji.yaginuma
53e6fe96b5 Correctly check whether key is defined in configuration
It can not check correctly with `defined?`

```ruby
irb(main):001:0> Rails.application.config.active_record
=> {:maintain_test_schema=>true, :belongs_to_required_by_default=>true}
irb(main):002:0> defined?(Rails.application.config.active_record)
=> nil
```

Follow up to #28469
2017-03-19 21:19:09 +09:00
Simon Dawson
8ee1683698 Remove stray back-end from ActiveJob Basics guide
The hyphenated form "back-end" only appears once in this guide; elsewhere, the un-hyphenated form "backend" is used consistently.
2017-03-19 08:34:47 +00:00
Simon Dawson
aa56c89eb2 Minor grammar fixes for Rails 5.1 release notes 2017-03-19 08:31:49 +00:00
Jon Moss
9cc2f50f9c Update some jquery-ujs references to rails-ujs
[ci skip]
2017-03-18 22:41:15 -04:00
Jon Moss
5e8dfcd12d Add link to rails-ujs/dropping jQuery PR
[ci skip]
2017-03-18 22:20:01 -04:00
Jon Moss
061927b4a8 Add link to Webpack/Webpacker PR
[ci skip]
2017-03-18 22:15:27 -04:00
Jon Moss
cb12b2a075 Second pass on 5.1 release notes
[ci skip]
2017-03-18 22:09:53 -04:00
Jon Moss
33786f62f9 First pass on 5.1 release notes
Fixing tons of grammar, etc.

[ci skip]
2017-03-18 22:07:20 -04:00
Jon Moss
9bcc021286 Merge pull request #28446 from y-yagi/move_new_changelog_entry_to_the_top
Move new CHANGELOG entry to the top [ci skip]
2017-03-18 21:39:50 -04:00
Jon Moss
ed47cdb1a1 Merge pull request #28467 from baerjam/improve-caching-guides
Improve Caching with Rails Guides [ci skip]
2017-03-18 21:36:41 -04:00
Matthew Draper
00c4a16c08 Merge pull request #28469 from matthewd/new-new-defaults
Track the version-compatible config settings inside railties
2017-03-19 09:31:02 +10:30
Ryuta Kamizono
59db5f2292 Use load rather than collect for force loading
Since b644964b `ActiveRecord::Relation` includes `Enumerable` so
delegating `collect`, `all?`, and `include?` are also unneeded.
`collect` without block returns `Enumerable` without preloading by that.
We should use `load` rather than `collect` for force loading.
2017-03-19 02:44:51 +09:00
Ryuta Kamizono
cf4f05a7d4 Delegate uniq to records
This fixes CI failure due to 48f3be8c.

`Enumerable#uniq` was introduced since Ruby 2.4. We should delegate
`uniq` to `records` explicitly.

And since b644964b `ActiveRecord::Relation` includes `Enumerable` so
delegating `map` is unneeded.
2017-03-18 15:15:24 +09:00
Andrew White
fd16e1a92f Always use original url_for when generating direct routes
Action View overrides `url_for` in the view context to render paths by
default when using `url_for` and this means that direct route helpers
don't get the full url when called with the url suffix. To fix this
always call the original `url_for`.
2017-03-17 21:30:29 +00:00
Matthew Draper
4183ee8820 Track the version-compatible config settings inside railties
Instead of forcing new applications to carry an initializer that just
switches things to what their default "should" be, we can handle it
internally.

The initializer is then only used by upgraders: it shows what the new
default would be (commented out), while their upgraded application
continues to operate as it did before.

Under this model, a multiply-upgraded application could accumulate
several new_framework_defaults_*.rb files, for each release series it
has traversed. A given release series only needs to generate the latest,
though, because we don't support `rails app:upgrade` while skipping
releases.
2017-03-18 07:30:30 +10:30
James Baer
da7c4126d3 Improve Caching with Rails Guides [ci skip]
Adds the "Caching in Development" section to
demonstrate usage of the dev:cache task in development mode.

Also, makes a small grammatical correction in section 2.4.
2017-03-17 16:02:24 -04:00
Rafael França
bac40b9cc8 Merge pull request #28191 from eugeneius/string_assoc_order
Allow order to be given expressions as hash keys
2017-03-17 13:22:20 -04:00
Rafael Mendonça França
6f7e7aadfd
Merge pull request #28154 from aripollak/remove-comments-from-structure-sql
Drop comments from structure.sql in postgresql
2017-03-17 13:17:29 -04:00
Rafael Mendonça França
7b02f86680
Fix resolve usage in the release notes
[ci skip]
2017-03-17 13:14:51 -04:00
Rafael França
c053d95481 Merge pull request #28096 from prathamesh-sonpatki/5-1-release-notes-first-draft
Add first draft of release notes for Rails 5.1 🎉
2017-03-17 13:13:36 -04:00
Rafael Mendonça França
48f3be8cc9
uniq was deprecated and removed already
This was causing an infinity loop since it was delegating to `all` and
all delegating back to this module.
2017-03-17 13:10:54 -04:00
Andrew White
35afd2c53b Add support for calling nested direct routes (#28462)
Not all requirements can be expressed in terms of polymorphic url
options so add a `route_for` method that allows calling another
direct route (or regular named route) which a set of arguments, e.g:

    resources :buckets

    direct :recordable do |recording|
      route_for(:bucket, recording.bucket)
    end

    direct :threadable do |threadable|
      route_for(:recordable, threadable.parent)
    end

This maintains the context of the original caller, e.g.

    threadable_path(threadable) # => /buckets/1
    threadable_url(threadable)  # => http://example.com/buckets/1
2017-03-17 18:07:09 +01:00
Rafael França
7413be0d31 Merge pull request #28341 from mtsmfm/pass-options-to-driven-by
Pass options to `driven_by`
2017-03-17 11:39:13 -04:00
Rafael França
3666962dd0 Merge pull request #28318 from bogdanvlviv/remove-ability-update-locking_column-value
Remove ability update locking_column value
2017-03-17 11:28:50 -04:00
George Claghorn
73b86ac58b Add :default option to belongs_to (#28453)
Use it to specify that an association should be initialized with a
particular record before validation. For example:

    # Before
    belongs_to :account
    before_validation -> { self.account ||= Current.account }

    # After
    belongs_to :account, default: -> { Current.account }
2017-03-17 15:29:19 +01:00
eileencodes
eadbc82c47 Bump Capybara and include Minitest::Assertions
Capybara was updated in teamcapybara/capybara#1841 to use Minitest style
assertions so that system test output shows x number of assertions, x
numbe of failures, etc.

Before:

```
6 runs, 0 assertions, 0 failures, 0 errors, 0 skips
```

After:

```
6 runs, 7 assertions, 1 failures, 0 errors, 0 skips
```

This change bumps Capybara from 2.7.0 to 2.13.0 and includes the
required minitest assertion file in the test case. 🎉
2017-03-17 08:22:22 -04:00
Vipul A M
0a4d1c3cde Cleanup documentation fixes (#28460) 2017-03-17 17:33:35 +05:30
Vipul A M
d730e74bce Merge pull request #28421 from tangposmarvin/docs-assest-pipeline
Fix guide incorrectly refers to public/assets/images [ci ckip]
2017-03-17 12:22:35 +05:30
Vipul A M
7f6b0721ae Merge pull request #28444 from budnik/patch-2
Updates incorrect documentation [ci skip]
2017-03-17 12:21:54 +05:30