Commit Graph

5871 Commits

Author SHA1 Message Date
Gannon McGibbon 2987f34ee1 Reword RDBMS note in ActiveRecord basics
[ci skip]
2019-02-13 19:16:52 -05:00
Eileen M. Uchitelle 8d9d46fdae
Merge pull request #35034 from sponomarev/chore/ac-docs-worker-pool
Add Worker Pool section to Action Cable configuration docs
2019-02-12 19:09:41 -05:00
Ryuta Kamizono fb60def5a4 Revert "Merge pull request #35216 from CHTJonas/patch-1"
This reverts commit b46601b56d, reversing
changes made to 4e6737f18a.
2019-02-11 23:53:31 +09:00
Eileen M. Uchitelle b46601b56d
Merge pull request #35216 from CHTJonas/patch-1
Correct JavaScript guide example
2019-02-11 09:18:00 -05:00
Ryuta Kamizono 713cee01a5 Fix typo a -> an, an -> a [ci skip] 2019-02-11 17:03:10 +09:00
Ryuta Kamizono 2328331f79 Revert "Merge pull request #33563 from lzap/foreign-key-note-doc"
This reverts commit 141f50ef9e, reversing
changes made to 317efa5c35.

Reason: `add_foreign_key` and `remove_foreign_key` are implemented at
#35212.

[ci skip]
2019-02-11 16:00:01 +09:00
Charlie Jonas 768a081751
Correct JavaScript example in guide [ci skip]
Swap `#users` jQuery selector to correct position and prevent the escaping of HTML.
2019-02-10 20:46:52 +00:00
Aaron Patterson 7d0ce785d4
Remove finalizer and configuration 2019-02-06 16:57:04 -08:00
Matthew Draper 287920ca7d Respect ENV variables when finding DBs etc for the test suite
If they're not set we'll still fall back to localhost, but this makes it
possible to run the tests against a remote Postgres / Redis / whatever.
2019-02-06 01:20:06 +10:30
Sergey Ponomarev 0375ccbae3
Specify sqlite gem version explicitly in version-specific bug report templates 2019-02-04 17:38:54 -05:00
Stephen Pike df55d28184 Add a link to where "inquiry" is defined in ActiveSupport docs
[ci skip]
2019-02-04 13:09:19 -05:00
Gannon McGibbon 5da63c1d56
Merge pull request #35086 from gsamokovarov/cleanup-whitelisting-refs
Cleanup the whitelisting references after #33145
2019-02-04 11:09:46 -05:00
utilum 744ef60449 Update template missing text in Guide
Changes the Getting Started guide explanation for
`ActionController::MissingExactTemplate` error, to reflect the current message.

Follow up for #29286, #35148

[ci skip]
2019-02-04 15:57:37 +01:00
utilum 3eeb063afd Fix and update template_missing image in guide
This commit updates the Missing Template image in the Getting Started
Guide.

The new image displays the current error message. Additionally:
- New image is a PNG file, whereas the current image is in fact a misnamed JPEG.
- New image is smaller.

Before:

```
$ file --mime -b template_is_missing_articles_new.png
image/jpeg; charset=binary
$ du -h template_is_missing_articles_new.png
464K    template_is_missing_articles_new.png
```

After:

```
$ file --mime -b template_is_missing_articles_new.png
image/png; charset=binary
$ du -h template_is_missing_articles_new.png
28K     template_is_missing_articles_new.png
```

[ci-skip]
2019-02-04 14:12:21 +01:00
Genadi Samokovarov ca62dfeede Cleanup the whitelisting references after #33145
During the development of #33145, I have named a few concepts in the
code as `whitelisted`. We decided to stay away from the term and I
adjusted most of the code afterwards, but here are the cases I forgot to
change.

I also found a case in the API guide that we could have cleaned up as
well.

[ci skip]
2019-02-03 10:58:10 +02:00
Andy Waite fc54809461 Use consistent hash syntax for routes
[ci skip]
2019-02-01 19:48:35 -05:00
Sergey Ponomarev 2929186e21
Add Worker Pool section to Action Cable configuration docs 2019-02-01 18:54:28 -05:00
Aaron Patterson 535a8b9957
Merge pull request #35093 from rails/av-base-constructor
Tighten up the AV::Base constructor
2019-01-30 11:57:47 -08:00
Vladimir Dementyev 8ed276b2f7
Add ActionCable channel/connection load hooks 2019-01-29 22:07:49 -05:00
Aaron Patterson e17fe52e0e
Tighten up the AV::Base constructor
The AV::Base constructor was too complicated, and this commit tightens
up the parameters it will take.  At runtime, AV::Base is most commonly
constructed here:

  94d54fa4ab/actionview/lib/action_view/rendering.rb (L72-L74)

This provides an AV::Renderer instance, a hash of assignments, and a
controller instance.  Since this is the common case for construction, we
should remove logic from the constructor that handles other cases.  This
commit introduces special constructors for those other cases.
Interestingly, most code paths that construct AV::Base "strangely" are
tests.
2019-01-29 15:49:40 -08:00
Robin Dupret de0c705516 Fix a tiny typo [ci skip]
Follow-up to #35055.
2019-01-26 18:13:58 +01:00
bughit 1c5e2f9b98
document the possibility of app initializers running before gem initilizers
and suggest a workaround
2019-01-25 13:32:26 -05:00
Ricardo Diaz 4409ab1006 Fix typo in ActionCable::Connection::TestCase reference 2019-01-24 20:35:58 -05:00
Kasper Timm Hansen 36c840057f
Merge pull request #35021 from palkan/refactor/broadcasting-for-testing
Action Cable: move channel_name to Channel.broadcasting_for
2019-01-24 23:40:33 +01:00
George Claghorn c1e949e9e6 Prefer ImageProcessing's resize_to_limit macro over resize_to_fit
Don't upsize images smaller than the specified dimensions.
2019-01-24 11:46:42 -05:00
Alan Brown 6d6be1f194
Corrected spelling of ActionCable::Connection::TestCase 2019-01-22 16:19:09 -08:00
Vladimir Dementyev cfe65cb478
fix fixture syntax in cable docs and guides 2019-01-22 16:53:01 -05:00
Vladimir Dementyev dc80459a9e
Move `channel_name` to Channel.broadcasting_for
That would allow us to test broadcasting made with channel, e.g.:

```ruby
class ChatRelayJob < ApplicationJob
  def perform_later(room, msg)
    ChatChannel.broadcast_to room, message: msg
  end
end
```

To test this functionality we need to know the underlying stream name
(to use `assert_broadcasts`), which relies on `channel_name`.

We had to use the following code:

```ruby
assert_broadcasts(ChatChannel.broadcasting_for([ChatChannel.channel_name, room]), 1) do
  ChatRelayJob.perform_now
end
```

The problem with this approach is that we use _internal_ API (we shouldn't care about `channel_name` prefix
in our code).

With this commit we could re-write the test as following:

```ruby
 assert_broadcasts(ChatChannel.broadcasting_for(room), 1) do
   ChatRelayJob.perform_now
 end
```
2019-01-22 15:14:20 -05:00
Eileen M. Uchitelle e26f0658da
Merge pull request #34997 from alkesh26/typo-fix-webserver
Replaced webserver with web server
2019-01-22 11:13:37 -05:00
alkesh26 97909ddcf2 Changed webserver to web server. 2019-01-22 21:11:03 +05:30
bogdanvlviv 0bc62b9c27
Add missing entries to guides' changelog file [ci skip]
We added "Action Mailbox Basics", "Action Text Overview" guides(#34812, #34878)
I think it makes to mention about it in the changelog file. (Similar to 7200ec92f8)
Note that entries retain original author since
I just moved content from readme files to the guides.
2019-01-21 09:16:51 +00:00
Ryuta Kamizono 31e118c39d
Merge pull request #34988 from bogdanvlviv/fix-development_dependencies_install
Update "Development Dependencies Install" guide [ci skip]
2019-01-20 11:45:15 +09:00
bogdanvlviv 535af8798c
Fix "Development Dependencies Install" guide [ci skip]
Since we use [workspaces](https://yarnpkg.com/lang/en/docs/workspaces/)
`yarn install` from the root should install all the javascript dependencies.
2019-01-19 23:28:25 +00:00
Rafael Mendonça França 5a0230c67f
Preparing for 6.0.0.beta1 release 2019-01-18 15:42:12 -05:00
Rafael Mendonça França f59b08119b
Change `SQLite3Adapter` to always represent boolean values as integers 2019-01-17 16:08:32 -05:00
Rafael França 05350eda9b
Merge pull request #34213 from matildasmeds/guides_session_guidelines_2
Edit Security Guide's Session Guidelines & Custom Credentials [skip ci]
2019-01-17 10:19:09 -05:00
Javan Makhmali 385d31d209 Minimize boilerplate setup code for JavaScript libraries 2019-01-16 16:15:43 -05:00
Kasper Timm Hansen 7e52e3b1c0
Merge pull request #34947 from bogdanvlviv/actioncable-testing-34933
Add `rails test:channels` and fix Action Cable templates
2019-01-16 20:23:51 +01:00
bogdanvlviv a43052cbbc
Remove `frozen_string_literal` from Action Cable's template files
Related to 837f602fa1

Fix the testing guide.
2019-01-16 15:14:35 +00:00
Maurizio De Santis 1a098c542d Remove Decorator pattern in Overriding existing classes examples
Engines guide in the Overriding Models and Controllers section
references the Decorator pattern, which isn't appropriate, since
Decorator pattern is not about reopening existing classes, is about
adding functionality to existing object instances; something that in
Ruby is commonly implemented using Delegators.

Moreover, the suggested naming convention for overrides,
`app/decorators/**/*_decorator*.rb`, conflicts with a naming convention
commonly used for View Model / Presentation Model decorators, adopted
by popular gems such as `draper`, as well as by custom implementations.
2019-01-16 14:16:46 +01:00
Laerti 41ffddbc8b Refs #28025 nullify *_type column on polymorphic associations on :nu… (#28078)
This PR addresses the issue described in #28025. On `dependent: :nullify` strategy only the foreign key of the relation is nullified. However on polymorphic associations the  `*_type` column is not nullified leaving the record with a NULL `*_id` but the `*_type` column is present.
2019-01-15 23:03:20 +09:00
Richard Macklin f8076e14b4 Document the ActionCable JS changes in the upgrade guide & release notes 2019-01-14 15:49:06 -08:00
Vladimir Dementyev a4099debcf
Add Action Cable Testing guides 2019-01-14 11:16:59 -05:00
Ryuta Kamizono 2ab9e968c7
Merge pull request #34932 from bogdanvlviv/fix-action-cable-guide-follow-up-34709
Fix "Action Cable Overview" guide [ci skip]
2019-01-14 06:22:22 +09:00
bogdanvlviv c50930296b
Fix "Action Cable Overview" guide [ci skip]
Fix path to channel files.

`rails generate channel Chat` generates `app/javascript/channels/chat_channel.js`.
See also,
railties/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt,
actioncable/lib/rails/generators/channel/templates/javascript/index.js.tt
by default `application.js` imports "channels", where
`app/javascript/channels/index.js` loads all the channels within
this directory and all subdirectories.

Follow up #34709
Related to #33079
2019-01-13 23:18:21 +02:00
bogdanvlviv 8e7d9ce8cb
Merge `actioncable/README.md` to the Action Cable Overview guide [ci skip]
In #34709 we updated the guide, but `actioncable/README.md` is still
outdated. Instead of fixing content in the file. I suggest
not duplicate the info that is already in the guide and instead remove
the info from the file and just add a message:
"You can read more about Action Cable in the
[Action Cable Overview](https://edgeguides.rubyonrails.org/action_cable_overview.html) guide."

The same approach is being used for Action Mailbox and Action Text,
see #34812 and #34878.
2019-01-13 19:45:04 +00:00
George Claghorn 512b5316dd
Add Exim and Qmail support to Action Mailbox 2019-01-12 21:38:26 -05:00
Gannon McGibbon c11cf116f3
Merge pull request #34902 from lanzhiheng/improve-doc-in-routing-2-10-adding-member-routes
improve doc in `Adding Member Routes` section of routing chapter.
2019-01-11 14:18:41 -05:00
Gannon McGibbon eedd9548ad
Merge pull request #34913 from bogdanvlviv/docs_config_action_mailer_delivery_job
Add info about `config.action_mailer.delivery_job` to the guide [ci skip]
2019-01-11 13:54:37 -05:00
bogdanvlviv 3f6449f4bf
Add info about `config.action_mailer.delivery_job` to the guide [ci skip]
Also, add mention to `new_framework_defaults_6_0.rb` that
`ActionMailer::Parameterized::DeliveryJob` is default for parameterized mail
and will be removed.

Related to #34692
2019-01-11 12:48:42 +00:00