Commit Graph

58035 Commits

Author SHA1 Message Date
bUg
e3cd321d4b Rails 5.1 point type should not raise exception if empty string is provided as value 2016-05-15 16:14:57 +03:00
Xavier Noria
0827f9932f reorder env keys in the generated config/cable.yml
Conventionally envs are ordered development -> test -> production.
2016-05-15 00:17:35 +02:00
Xavier Noria
88962bc342 Merge pull request #25002 from maclover7/jm-add-actioncable-guide
Add Action Cable guide to list
2016-05-14 14:57:41 -07:00
Xavier Noria
32fcfcd890 edit pass over the cable guide [ci skip] 2016-05-14 23:55:07 +02:00
Eileen M. Uchitelle
c83e6847c0 Merge pull request #24992 from tomkadwill/test_and_comment_server_port_rebased
Document and test ActionDispatch server_port
2016-05-14 11:38:59 -04:00
Vijay Dev
83ecf3fe56 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/configuring.md
2016-05-14 09:54:23 +00:00
Rafael França
4046ac7e88 Merge pull request #25008 from lvl0nax/as_enumarable_index_by_refactoring
Perfomance fix for ActiveSupport Enumerable#index_by
2016-05-14 03:43:09 -03:00
lvl0nax
6751b10320 Perfomance fix for Enumerable#index_by
Calculating -------------------------------------
              before    34.731k i/100ms
               after    48.206k i/100ms
-------------------------------------------------
              before    508.451k (± 1.2%) i/s -      2.570M
               after    720.068k (± 0.9%) i/s -      3.615M
Comparison:
               after:   720067.6 i/s
              before:   508451.1 i/s - 1.42x slower
2016-05-14 09:16:30 +03:00
Rafael França
b981369ab6 Merge pull request #25003 from kangkyu/missing_line
Add missing space and newline for clarity
2016-05-14 01:33:50 -03:00
Eileen M. Uchitelle
b6429b871f Merge pull request #25015 from joemasilotti/patch-1
Add notes on cosmetic patches to contributing guidelines
2016-05-13 15:12:48 -04:00
Joe Masilotti
6143de0b92 Add notes on cosmetic patches 2016-05-13 15:03:50 -04:00
Vipul A M
26e59e686c
Add output snippet from ActionController::API.ancestors - ActionController::Metal.ancestors command for api apps.
[ci skip]
2016-05-13 23:29:37 +05:30
Jon Moss
c0cf61e151 Add Action Cable guide to list
This effectively publishes the "Action Cable Overview" guide. If we
don't think this is ready for the prime time, we can mark it as a "work
in progress" guide.

[ci skip]
2016-05-13 09:33:31 -04:00
Kang-Kyu Lee
238c77dedf Add missing space and newline for clarity 2016-05-12 20:59:38 -07:00
Sean Griffin
0991c4c6fc Give more context from AssociationMismatchError
The error message that we give today makes this error difficult to debug
if you receive it. I have no clue why we're printing the object ID of
the class (the commit doesn't give context), but I've left it as it was
deliberate.
2016-05-12 22:20:45 -04:00
Richard Schneeman
8d11a8f253 Merge pull request #25001 from Neodelf/typos
Rename test method
2016-05-12 15:20:02 -05:00
Molchanov Andrey
37f2674d64 Rename test method 2016-05-12 22:45:18 +03:00
Tom Kadwill
775703e1f9 Document and test ActionDispatch server_port 2016-05-12 18:46:16 +01:00
Sean Griffin
6007e584d8 Fix false positive mutation detection when JSON is used with serialize
When looking for mutation, we compare the serialized version of the
value to the before_type_cast form. `Type::Serialized` was breaking this
contract by passing the already serialized attribute to the subtype's
mutation detection. This never manifested previously, as all mutable
subtypes either didn't do anything in their `serialize` method, or had a
way to detect double serialization (e.g. `is_a?(String)`). However, now
that JSON types can handle string primitives, we need to avoid double
serialization.

Fixes #24993.
2016-05-12 09:09:47 -04:00
Jon Moss
548c1d6e8b
Publish Action Cable to NPM when we release.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
2016-05-11 19:36:27 -07:00
Sean Griffin
d1794cd88c Merge pull request #24980 from merhard/virtual-attribute-default
Define ActiveRecord::Attribute::Null#type_cast
2016-05-11 22:00:37 -04:00
Kasper Timm Hansen
50ef6ed450 Merge pull request #24982 from tomkadwill/improve_clarity_of_raw_host_with_port
Improve documentation and tests for raw_host_with_port and host_with_…
2016-05-11 22:07:27 +02:00
Tom Kadwill
6b9bd2e3b0 Improve documentation and tests for raw_host_with_port and host_with_port 2016-05-11 20:38:13 +01:00
Arthur Neves
537a342a83
remove_connection should not remove parent connection
When calling remove_connection in a subclass, that should not fallback
to the parent, otherwise it will remove the parent connection from the
handler.
2016-05-11 13:39:26 -04:00
Matthew Erhard
556e530da4 Define ActiveRecord::Attribute::Null#type_cast
Using ActiveRecord::Base.attribute to declare an attribute with a default value on a model where the attribute is not backed by the database would raise a NotImplementedError when model.save is called.

The error originates from 59d252196b/activerecord/lib/active_record/attribute.rb (L84).
This is called from 59d252196b/activerecord/lib/active_record/attribute.rb (L46) on an ActiveRecord::Attribute::Null object.

This commit corrects the behavior by implementing ActiveRecord::Attribute::Null#type_cast.

With ActiveRecord::Attribute::Null#type_cast defined, ActiveRecord::Attribute::Null#value (59d252196b/activerecord/lib/active_record/attribute.rb (L173..L175)) can be replaced with its super method (59d252196b/activerecord/lib/active_record/attribute.rb (L36..L40)).

fixes #24979
2016-05-11 13:21:01 -04:00
Arthur Nogueira Neves
59d252196b Merge pull request #24977 from fgo/patch-19
Getting Started Guide: Add invoke test_unit to files table [ci skip]
2016-05-11 11:22:45 -04:00
Francis Go
72985ba949 Getting Started Guide: Add invoke test_unit to files table [ci skip] 2016-05-12 00:49:00 +10:00
Vipul A M
b8761ed442 Merge pull request #24974 from mohitnatoo/arrayinquirer-any-definition
Added clarity to documentation of ArrayInquirer#any? [ci skip]
2016-05-11 20:05:23 +05:30
Mohit Natoo
a2959abbc6 - Added clarity to documentation of ArrayInquirer#any? [ci skip]
- Added clarity to documentation of ArrayInquirer#any? [ci skip]

- Added clarity to documentation of ArrayInquirer#any? [ci skip]
2016-05-11 20:03:18 +05:30
प्रथमेश Sonpatki
bd04c0656c Merge pull request #24975 from fgo/patch-18
Getting Started Guide: Add channels and jobs to purpose table [ci skip]
2016-05-11 19:50:25 +05:30
Francis Go
886bd9df95 Getting Started Guide: Add channels and jobs to app purpose table [ci skip] 2016-05-12 00:17:17 +10:00
Santiago Pastorino
5f7d3363c5 Merge pull request #24912 from prathamesh-sonpatki/api-fix-response-format
API only apps: Preserve request format for HTML requests too
2016-05-11 11:13:35 -03:00
Arthur Nogueira Neves
733161d48b Merge pull request #24971 from arthurnn/arthurnn/dont_cache_specification_name
Dont cache the conn_spec_name when empty
2016-05-11 09:02:10 -04:00
Arthur Neves
897decaceb
Set conn_spec_name after remove
`remove_connection` can reset the `connection_specification_name`, so we
need to to set it after the remove_connection call on
`establish_connection` method.
2016-05-11 08:37:56 -04:00
Arthur Neves
f1030fd897
Dont cache the conn_spec_name when empty
We cannot cache the connection_specification_name when it doesnt
exist. Thats because the parent value could change, and we should keep
failling back to the parent. If we cache that in a children as an ivar,
we would not fallback anymore in the next call, so the children would
not get the new parent spec_name.
2016-05-11 08:04:26 -04:00
Vipul A M
525fa7ef7c [ci skip] Update documents of ConnectionHandler
[ci skip] Update documents of `ConnectionHandler`
2016-05-11 14:20:58 +05:30
प्रथमेश Sonpatki
b185db5d61 Merge pull request #24967 from fgo/patch-17
Getting Started Guide: Update Ruby version to 2.3.1p112 [ci skip]
2016-05-11 14:15:53 +05:30
Francis Go
913542f794 Getting Started Guide: Update Ruby version to 2.3.1p112
[ci skip]
2016-05-11 17:29:24 +10:00
yui-knk
64634ce61a [ci skip] Update documents of ConnectionHandler
Follow up of #24844.
The key of `@owner_to_pool` was changed from `klass.name` to
`spec.name`. By this change "memory leaks in development mode"
will not happen, bacause the equality of string is not changed
by reloading of model files.
2016-05-11 13:40:57 +09:00
Arthur Neves
d6f3ad7ce7
Make sure we reset the connection_specification_name on
remove_connection

When calling `remove_connection` on a model, we delete the pool so we also
need to reset the `connection_specification_name` so it will fallback to
the parent.
This was the current behavior before rails 5, which will fallback to the
parent connection pool.

[fixes #24959]

Special thanks to @jrafanie for working with me on this fix.
2016-05-10 23:42:26 -04:00
Prathamesh Sonpatki
c33bda875e
API only apps: Preserve request format for HTML requests too
- Earlier we were responding with JSON format for HTML requests in a API
  app.
- Now we will respond with HTML format for such requests in API apps.
- Also earlier we were not testing the API app's JSON requests
  properly. We were actually sending HTML requests. Now we send correct
  JSON requests. Also added more test coverage.
- Based on the discussion from this commit -
  05d89410bf.

[Prathamesh Sonpatki, Jorge Bejar]
2016-05-11 09:04:02 +05:30
Vipul A M
c181c9a369
Remove ambiquity in what we are referring to in the documentation of config vs configuring the server itself 2016-05-11 04:01:40 +05:30
Vipul A M
94660de4e5
Document config.action_dispatch.ignore_accept_header and config.action_dispatch.x_sendfile_header in configuring guide 2016-05-11 03:54:02 +05:30
Vipul A M
bc7a626956
More missing true literal quotings 2016-05-11 03:19:45 +05:30
Vipul A M
d6e1c83512
Lets be consistent in the usage of true/false across this guide. It should be quoted as how other config options are. They are already quoted at many places. This change, makes this usage consistent. Note that, this is quoting literal values true and false, not truthy values 2016-05-11 03:10:38 +05:30
Vipul A M
8b59b5e75e
Document missing smtp config over at configuring guide. [ci skip] 2016-05-11 02:59:30 +05:30
Vipul A M
9f525e87ab
This config still applies for Rails 4 Apps and we need to mention it, what was needed before. [ci skip] 2016-05-11 02:50:30 +05:30
Jon Moss
932655a4ef Merge pull request #24956 from zachattack/patch-1
Minor syntax change
2016-05-10 15:17:19 -04:00
Zach
bb53774a91 Minor syntax change
While working on this very example recently, I found that Rails will throw POST errors if you leave an empty block in front the `format.js` when using either `remote: true` or vanilla  JS/JQuery.
2016-05-10 11:34:12 -05:00
Rafael França
6dec764519 Merge pull request #24950 from kamipo/should_quote_lock_name
Should quote `lock_name` to pass to `get_advisory_lock`
2016-05-10 05:10:23 -03:00