Commit Graph

59330 Commits

Author SHA1 Message Date
David Heinemeier Hansson
debd774d63 Include the content of the flash in the auto-generated etag (#26250)
Include the content of the flash in the auto-generated etag
2016-08-22 13:34:35 -07:00
Rafael França
3bfd352452 Merge pull request #26249 from rafamanzo/add_redis_to_development_dependencies
Update docs with Action Cable Redis dependency
2016-08-22 16:51:38 -03:00
Rafael Mendonça França
df84e98672
Remove the SchemaDumper options and change the default behavior
Now the schema dumper by default doesn't align the types and arguments
in the ruby format anymore.
2016-08-22 15:46:04 -03:00
Rafael Reggiani Manzo
65b5960759 [ci skip] Update docs with Action Cable Redis dependency
Action Cable's test `test/subscription_adapter/redis_test.rb` fail if
Redis is not installed and running.

Following the guides `development_dependen there's no mention to this.
2016-08-22 14:44:46 -03:00
प्रथमेश Sonpatki
d25a5ce256 Merge pull request #26248 from wjordan/remove-dynamic-segments-doc
Remove `:action` and `:controller` segments from routing guide
2016-08-22 22:59:55 +05:30
Will Jordan
8c1fdf679e Remove :action and :controller segments from routing guide
Fixes #26247.
[ci skip]
2016-08-22 17:19:28 +00:00
Eileen M. Uchitelle
9caca55f71 Merge pull request #25750 from go2null/go2null-test-directories
Specified directories for routes, views and jobs tests
2016-08-22 13:13:20 -04:00
Kasper Timm Hansen
46a4424306 Merge pull request #23941 from chiragsinghal/patch-1
Return 307 status instead of 301 when rerouting POST requests to SSL
2016-08-22 17:43:47 +02:00
go2null
90fbae6acc Clearly state purpose of test directories
* Added location for route, view and job tests to section 2.1.  (They are currently only defined in sections 8 Testing Views and 11 Testing Jobs.)
* Added location for route test in section 7 Testing Routes.  (Currently only defined in section 8 Testing Views.)
2016-08-22 11:27:22 -04:00
Vipul A M
eb8a1e2df8 Merge pull request #26245 from danila/quering-interface-guide
Change form of table name to plural in quering interface guides [ci skip]
2016-08-22 18:09:21 +05:30
Danila Ermakov
3b7642a328 Change form of table name to plural in query example 2016-08-22 15:24:19 +03:00
Chirag Singhal
64f9802e90 Return 307 status instead of 301 when rerouting POST requests to SSL
When `config.force_ssl` is set to `true`, any POST/PUT/DELETE requests coming in to non-secure url are being redirected with a 301 status.
However, when that happens, the request is converted to a GET request and ends up hitting a different action on the controller.

Since we can not do non-GET redirects, we can instead redirect with a 307 status code instead to indicate to the caller that a fresh request should be tried preserving the original request method.

`rack-ssl` gem which was used to achieve this before we had this middleware directly baked into Rails also used to do the same, ref: https://github.com/josh/rack-ssl/blob/master/lib/rack/ssl.rb#L54

This would be specially important for any apps switching from older version of Rails or apps which expose an API through Rails.
2016-08-22 10:53:41 +05:30
प्रथमेश Sonpatki
9ef56e5162 Merge pull request #26240 from ojiry/fix_ad_http_url_doc
Fix `ActionDispatch::Http::URL` docs [ci skip]
2016-08-22 10:31:57 +05:30
Ryoji Yoshioka
602fe9324a Fix ActionDispatch::Http::URL docs [ci skip]
Use ActionDispatch::Request instead of Request because ActionDispatch::Request no longer inherits from Rack::Request.
2016-08-22 13:47:17 +09:00
Jon Moss
409dbc891d Merge pull request #26241 from scottyantipa/query-interface-docs
Upate guides to properly define return values of finder methods
2016-08-21 22:01:28 -04:00
Kasper Timm Hansen
0f0349b7ee Merge pull request #23759 from maclover7/fix-23757
Prevent invocation of channel action if rejected connection
2016-08-21 21:21:44 +02:00
Kasper Timm Hansen
0432652f23 Merge pull request #26234 from y-yagi/remove_unnessary_session_store_setting
remove  unnessary `session_store` setting
2016-08-21 21:04:19 +02:00
Scott Antipa
f3626c38fc Update docs for query interface to not declare that all methods return instance of ActiveRecord::Relation 2016-08-21 11:17:37 -07:00
Vijay Dev
3e2be0bf14 Merge branch 'master' of github.com:rails/docrails 2016-08-21 10:48:53 +00:00
Vijay Dev
fae7c46285 Merge pull request #26227 from alexcameron89/syntax_highlighter_fix
Increase margin-bottom for doc's code syntax highlighter
2016-08-20 23:01:43 +05:30
Alex Kitchens
5624d1158e Increase margin-bottom for doc's code syntax highlighter
Fixes #25744 by slightly increasing the margin in code syntax
highlights. With a margin of 0, it was cutting off underscores in Linux
browesers, so I slightly increased it to 0.5px.
2016-08-20 11:56:03 -05:00
yuuji.yaginuma
3173244d4b remove unnessary session_store setting
Since e5a6f7ee9e951dbe0e4e9ea2c0743b4dfb135c57, by default the session store
will be set to cookie store with application name as session key.
2016-08-20 20:24:17 +09:00
Sean Griffin
02c9a78489 Merge pull request #26232 from kamipo/fix_oid_bit_cast_value
Fix `OID::Bit#cast_value`
2016-08-20 06:40:15 -04:00
प्रथमेश Sonpatki
bf35e2f33a Merge pull request #26233 from y-yagi/update_retry_on_example
correct exception class in `retry_on` example [ci skip]
2016-08-20 14:18:51 +05:30
yuuji.yaginuma
88f9a1540a correct exception class in retry_on example [ci skip]
If the deadlock has occurred `ActiveRecord::Deadlocked` will raise.
Ref: #25107, #26059
2016-08-20 17:21:14 +09:00
Ryuta Kamizono
f1d9fc5d34 Fix OID::Bit#cast_value
Fixes #26137.
2016-08-20 08:56:54 +09:00
Eileen M. Uchitelle
01a8e0c24e Merge pull request #26224 from jonatack/consistent-asset-precompile-examples
Consistent examples and template for assets#precompile
2016-08-19 16:52:16 -04:00
Jon Atack
b4c92be471 Consistent examples and template for assets#precompile
Listening to a few developers today discussing their troubles in understanding how to use the asset pipeline, it turns out that the precompile examples in the guides and assets.rb template have over time become a bit inconsistent.

This PR makes the examples consistent in code style, spacing, and asset names, removes the old 'swfObject.js' example, and in a couple of places wraps lines at 80 characters including in the assets.rb template.

Re-add spaces inside array parentheses.
2016-08-19 22:24:54 +02:00
Jon Moss
831e2c8d1b Prevent invocation of channel action if rejected connection
Fixes #23757.

Before this commit, even if `reject` was called in the `subscribe`
method for an Action Cable channel, all actions on that channel could
still be invoked. This calls a `return` if a rejected connection tries
to invoke any actions on the channel.
2016-08-19 13:00:39 -04:00
Vipul A M
18e599940a
When referring to Rails, be consistent in usage of capitalized form, unless it is used in context of a command like bin/rails or the rails directory [ci skip] 2016-08-19 14:17:07 +05:30
Vipul A M
5b5437caeb
Grammar changes on getting started guide, specify where exactly the example is that we are referring to. [ci skip] 2016-08-19 14:14:32 +05:30
Rafael França
c1d612cf5a Merge pull request #26219 from kamipo/remove_unused_blob_or_text_column
Remove unused `blob_or_text_column?` method
2016-08-19 02:47:21 -03:00
Rafael França
a0d24a9c4d Merge pull request #26218 from kamipo/remove_unnecessary_length
Remove unnecessary `length` method for collection proxy
2016-08-19 02:44:45 -03:00
Ryuta Kamizono
9e6a455381 Remove unused blob_or_text_column? method 2016-08-19 14:09:55 +09:00
Rafael Mendonça França
544d44fb53
Copy edits in the documentation [ci skip] 2016-08-19 01:48:56 -03:00
Rafael França
03b9a11f93 Merge pull request #26212 from evmunro/as-json-sets-request-to-json-for-controller-test
Allow setting of request CONTENT-TYPE with as: in controller tests
2016-08-19 01:42:21 -03:00
Rafael Mendonça França
e87158f16b
Merge pull request #25675 from TimPetricola/schema-no-standardized-column-widths
Option not to line up column attributes in schema.rb
2016-08-19 01:28:39 -03:00
Ryuta Kamizono
dea671b5e0 Remove unnecessary length method for collection proxy
`length` is delegated to `records` (`load_target`) by
`ActiveRecord::Delegation`.

https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/relation/delegation.rb#L38
2016-08-19 13:12:03 +09:00
Rafael Mendonça França
15175fdad7
Add chengelog entry to #25976
[Rafael Mendonça França + Robin Dupret]
2016-08-19 01:08:09 -03:00
Rafael Mendonça França
bdf24f883f
Merge pull request #26154 from kamipo/remove_text_default_treated_as_empty_string
Remove text default treated as an empty string in non-strict mode
2016-08-19 01:04:03 -03:00
Rafael França
b27acd0b69 Merge pull request #26217 from kamipo/revert_23067
Revert "`sql_for_insert` returns values for passing to `exec_insert`"
2016-08-19 00:57:36 -03:00
Rafael França
3760efe00d Merge pull request #25989 from kamipo/remove_unnecessary_select_for_collection_proxy
Remove unnecessary `select` method for `CollectionProxy`
2016-08-19 00:57:16 -03:00
Rafael França
0db945ac95 Merge pull request #26216 from y-yagi/fixes_19880
run `before_configuration` callbacks as soon as application constant inherits from Rails::Application
2016-08-19 00:52:54 -03:00
Ryuta Kamizono
7db6bd7a23 Revert "sql_for_insert returns values for passing to exec_insert"
This reverts #23067. #23067 is for propagating `pk` value from
`sql_for_insert` to `exec_insert` (avoiding extra query for pg adapter).
Now `exec_insert` includes `sql_for_insert` since #26002 therefore this
propagating is no longer needed.
2016-08-19 12:43:03 +09:00
Rafael Mendonça França
eabf024369
Merge pull request #26089 from travisoneill/sqlite_rollback_fix
Sqlite3 Migration Error Fixed (issue #26087)
2016-08-19 00:26:02 -03:00
yuuji.yaginuma
72831d75b6 run before_configuration callbacks as soon as application constant inherits from Rails::Application
Until Rails 4.1, `before_configuration` run as soon as the application constant
inherits from `Rails::Application`.
However, in d25fe31c40928712b5e08fe0afb567c3bc88eddf, it has been modified to
run at instantiation process.

This modify to `before_configuration` is run at same timing as to Rails 4.1.

Fixes #19880
2016-08-19 12:12:00 +09:00
Ryuta Kamizono
99cb16a2ba Remove text default treated as an empty string in non-strict mode
Strict mode controls how MySQL handles invalid or missing values in
data-change statements such as INSERT or UPDATE. If strict mode is not
in effect, MySQL inserts adjusted values for invalid or missing values
and produces warnings.

```ruby
  def test_mysql_not_null_defaults_non_strict
    using_strict(false) do
      with_mysql_not_null_table do |klass|
        record = klass.new
        assert_nil record.non_null_integer
        assert_nil record.non_null_string
        assert_nil record.non_null_text
        assert_nil record.non_null_blob

        record.save!
        record.reload

        assert_equal 0,  record.non_null_integer
        assert_equal "", record.non_null_string
        assert_equal "", record.non_null_text
        assert_equal "", record.non_null_blob
      end
    end
  end
```

It is inconsistent with other types that only text/blob defaults treated
as an empty string. This commit fixes the inconsistency.
2016-08-19 12:11:26 +09:00
Rafael Mendonça França
28aaf77bb0
Merge pull request #24099 from k0kubun/preserve-readonly
Preserve readonly flag only for readonly association
2016-08-18 23:17:23 -03:00
Rafael França
085166d59a Merge pull request #26200 from kamipo/remove_unnecessary_ordinal_methods
Remove unnecessary ordinal methods for collection association
2016-08-18 23:14:27 -03:00
Rafael França
c2af081c4f Merge pull request #25999 from kamipo/remove_sanitize_conditions
Remove `sanitize_conditions` and use `sanitize_sql` instead of `sanitize_conditions`
2016-08-18 22:57:27 -03:00