Commit Graph

53939 Commits

Author SHA1 Message Date
Tanmay Sinha
73057f2115 [ci skip] Fix #seconds_since_midnight documentation output it will always return floating pointnumber 2015-10-05 00:06:01 +05:30
akihiro17
dc96af159d [ci skip] Fix ActiveRecord::Relation#update documentation
* before

```
people = Person.where(group: 'expert')
people.update(group: 'masters')

Note: Updating a large number of records will run a
UPDATE query for each record, which may cause a performance
issue. So if it is not needed to run callbacks for each update, it is
preferred to use <tt>update_all</tt> for updating all records using
a single query.
```

* after

```
people = Person.where(group: 'expert')
people.update(group: 'masters')
```
Note: Updating a large number of records will run an
UPDATE query for each record, which may cause a performance
issue. So if it is not needed to run callbacks for each update, it is
preferred to use <tt>update_all</tt> for updating all records using
a single query.
2015-10-05 03:01:54 +09:00
Claudio B.
5dfc7a9006 Merge pull request #21857 from cllns/fix-myspace-example-wording
Update text on CSS Injection
2015-10-04 10:14:09 -07:00
Sean Griffin
df9faf53e9 Merge pull request #21866 from tanmay3011/fix_documentation
Fix Time.now format in documentation [ci skip]
2015-10-04 08:02:23 -06:00
Sean Griffin
eee2aa31a6 Merge pull request #21863 from tanmay3011/use_applications_year
Use #current instead of #now to prevent zone issues and use new ruby …
2015-10-04 07:58:45 -06:00
Tanmay Sinha
73aa47e673 Fix Time.now format in documentation 2015-10-04 19:28:05 +05:30
Tanmay Sinha
b15e8dfd74 Use Time#current instead of Time#now to prevent zone issue inorder to use application's time zone 2015-10-04 19:23:55 +05:30
Sean Griffin
0e27ad3525 Merge pull request #21848 from yui-knk/test_suppress_warnings
Suppress warnings of `assigned but unused variable`
2015-10-04 07:39:46 -06:00
Vijay Dev
7976b6d306 Merge branch 'master' of github.com:rails/docrails 2015-10-04 12:33:14 +00:00
Gaurav Sharma
64e316edd3 action mailer test cases protected method can be # :nodoc: 2015-10-04 13:30:00 +05:30
Jeremy Daer
67597e1719 Merge pull request #21861 from jeremy/rack-add-header
Introduce `Headers#add`. Move `Response#add_header` upstream.
2015-10-03 22:05:01 -07:00
Jeremy Daer
2356403330 Introduce Headers#add. Move Response#add_header upstream.
* Introduce `ActionDispatch::Http::Headers#add` to add a value to
  a multivalued header.
* Move `Response#add_header` upstream: https://github.com/rack/rack/pull/957
* Match upstream `Response#have_header?` -> `#has_header?` name change.
2015-10-03 21:59:18 -07:00
Jeremy Daer
24b1850130 Missed Gemfile change in f849cfe36c585fbc58c4a5fd91b0ae1571d38bcb 2015-10-03 19:30:02 -07:00
Jeremy Daer
f849cfe36c YAGNI concurrent-ruby master branch now that 1.0.0.pre3 is released with fixes for warnings and circular require 2015-10-03 19:24:16 -07:00
Aaron Patterson
24f9c03d52 Revert "removing Rack::Runtime from the default stack."
This reverts commit 37423e4ff883ad5584bab983aceb4b2b759a1fd8.

Jeremy is right that we shouldn't remove this.  The fact is that many
engines are depending on this middleware to be in the default stack.
This ties our hands and forces us to keep the middleware in the stack so
that engines will work.  To be extremely clear, I think this is another
smell of "the rack stack" that we have in place.  When manipulating
middleware, we should have meaningful names for places in the req / res
lifecycle **not** have engines depend on a particular constant be in a
particular place in the stack.  This is a weakness of the API that we
have to figure out a way to address before removing the constant.

As far as timing attacks are concerned, we can reduce the granularity
such that it isn't useful information for hackers, but is still useful
for developers.
2015-10-03 14:21:31 -07:00
Eileen M. Uchitelle
99392112c5 Merge pull request #21860 from vngrs/wrong_usage_of_a_in_doc
Wrong usage of 'a' in docs fixed [ci skip]
2015-10-03 16:41:37 -04:00
Mehmet Emin İNAÇ
c4cc3be0d9 Wrong usage of 'a' in docs fixed [ci skip] 2015-10-03 23:39:31 +03:00
Sean Griffin
bcc3192e64 Merge pull request #21855 from acapilleri/save_perf
Add Singleton in NullMutationTracker class
2015-10-03 16:11:15 -04:00
Kasper Timm Hansen
7c5c511b0f Merge pull request #21853 from amitsuroliya/deprecated_string_middleware
Fixed deprecated string to specify the middleware [ci skip]
2015-10-03 22:05:10 +02:00
Gaurav Sharma
cd50eefdc5 nodoc for active support protected method [CI skip] 2015-10-04 01:18:21 +05:30
Sean Collins
19b626a31a Update text on CSS Injection / Myspace
[skip ci]
2015-10-03 12:42:33 -06:00
acapilleri
c08c4681ad Add Singleton in NullMutationTracker class
to reduce allocation of same object
2015-10-03 16:11:02 +02:00
Wojciech Wnętrzak
6e0254e8d3 Fixed serializing :at option for assert_enqueued_with and assert_performed_with 2015-10-03 15:23:05 +02:00
amitkumarsuroliya
208a33e387 Fixed deprecated string to specify the middleware [ci skip] 2015-10-03 18:19:32 +05:30
Kasper Timm Hansen
55ac94cec4 Merge pull request #21852 from morgoth/support-array-in-assert_enqueued_jobs-for-only-option
Support passing array to `assert_enqueued_jobs` in `:only` option
2015-10-03 13:33:50 +02:00
Wojciech Wnętrzak
8a67c56efb Support passing array to assert_enqueued_jobs in :only option 2015-10-03 13:25:16 +02:00
Kasper Timm Hansen
1b00c36d85 Merge pull request #21851 from y-yagi/use_class_to_specify_middleware
use class to specify the middleware [ci skip]
2015-10-03 12:57:09 +02:00
yuuji.yaginuma
70b09eda03 use class to specify the middleware [ci skip]
using string for middleware class names is deprecated in 83b767cef90abfc4c2ee9f4b451b0215501fae9a
2015-10-03 19:26:24 +09:00
yui-knk
218336fa54 Change Journey::Route#verb to return string instead of regexp.
By [this commit](0b476de445)
`Journey::Route#verb` need not to return verb as regexp.
The returned value is used by inspector, so change it to be a string.

Add inspect_with_multiple_verbs test case to keep the behavior of
inspector correctly.
2015-10-03 18:28:29 +09:00
yui-knk
2ded9c657a Suppress warnings of assigned but unused variable 2015-10-03 15:50:52 +09:00
Aaron Patterson
37423e4ff8 removing Rack::Runtime from the default stack.
The runtime header is a potential target for timing attacks since it
returns the amount of time spent on the server (eliminating network
speed).  Total time is also not accurate for streaming responses.

The middleware can be added back via:

```ruby
config.middleware.ues ::Rack::Runtime
```
2015-10-02 14:45:31 -07:00
Rafael Mendonça França
55e6d2f0e3 Merge pull request #21842 from morgoth/mark-private-methods-as-nodoc
Do not document private methods in AJ::TestHelper
2015-10-02 13:24:12 -03:00
Wojciech Wnętrzak
3d63e1c155 Do not document private methods in AJ::TestHelper
[CI skip]
2015-10-02 18:19:00 +02:00
Sean Griffin
7e6d1f13b1 Merge pull request #21809 from yui-knk/fix_doc_am_serialization
[ci skip] Fix explanation of `ActiveModel::Serialization`
2015-10-02 09:40:53 -04:00
Sean Griffin
524cbc2167 Merge pull request #21839 from andyatkinson/remove-unusued-scopes
Remove unused scopes
2015-10-02 09:40:41 -04:00
Sean Griffin
ede244e236 Build the AttributeMutationTracker lazily
For reads, we never need to construct this object. The double `defined?`
check is to avoid errors in tests
2015-10-02 09:37:31 -04:00
Andrew White
c80b114c45 Merge pull request #20600 from mtsmfm/xmlschema-should-display-more-than-6-digits
TimeWithZone#xmlschema should be able to display more than 6 digits
2015-10-02 13:55:47 +01:00
Sean Griffin
a9f66de352 Merge pull request #21539 from tgxworld/parameters_not_sanitized
Fix AC::Parameters not being sanitized for query methods.
2015-10-02 08:30:20 -04:00
Sean Griffin
b15b72233c 💣
I misread this test in
1a693c79c3
2015-10-02 08:21:36 -04:00
Sean Griffin
1a693c79c3 Fix test failures on MySQL
There were a few places where I missed a `create` vs `new`
before_type_cast check, and the semantics of `reload` became wrong.
2015-10-02 08:14:43 -04:00
Sean Griffin
07723c23a7 Further encapsulate dirty checking on Attribute
We can skip the allocation of a full `AttributeSet` by changing the
semantics of how we structure things. Instead of comparing two separate
`AttributeSet` objects, and `Attribute` is now a singly linked list of
every change that has happened to it. Since the attribute objects are
immutable, to apply the changes we simply need to copy the head of the
list.

It's worth noting that this causes one subtle change in the behavior of
AR. When a record is saved successfully, the `before_type_cast` version
of everything will be what was sent to the database. I honestly think
these semantics make more sense, as we could have just as easily had the
DB do `RETURNING *` and updated the record with those if we had things
like timestamps implemented at the DB layer.

This brings our performance closer to 4.2, but we're still not quite
there.
2015-10-02 08:03:11 -04:00
Guo Xiang Tan
7d0b1e4847 Fix AC::Parameters not being sanitized for query methods. 2015-10-02 16:26:16 +08:00
Jeremy Daer
9db73a2591 Merge pull request #21838 from jeremy/response-add-header
Response#add_header for adding to multi-valued headers like Vary
2015-10-01 21:54:18 -07:00
Jeremy Daer
28a1a39967 Response#add_header for adding to multi-valued headers like Vary 2015-10-01 21:52:57 -07:00
Andy Atkinson
73ec5a26a3 Remove unused scopes 2015-10-01 23:42:45 -05:00
yui-knk
1fdb98c033 [ci skip] Fix explanation of ActiveModel::Serialization
This explanation was change by https://github.com/rails/rails/commit/7a27de2b.
This change reversed the including module (`ActiveModel::Serializers::JSON`)
and the included module (`ActiveModel::Serialization`) by mistake.
2015-10-02 13:20:19 +09:00
Jeremy Daer
dd57f60de9 Merge pull request #21836 from jeremy/no-nil-set-cookie-headers
Don't set a nil Set-Cookie header when there aren't any cookies
2015-10-01 18:58:47 -07:00
Jeremy Daer
be5e6cea73 Don't set a nil Set-Cookie header when there aren't any cookies. Omit the header. 2015-10-01 18:47:13 -07:00
Kasper Timm Hansen
2c41b530b1 Merge pull request #21757 from Gaurav2728/gaurav-adding_x_frame_test
adding test for content type with default charset
2015-10-01 23:03:54 +02:00
Gaurav Sharma
d87427c6c7 adding test for content type with default charset
* first test is for `default_charset` i.e `ActionDispatch::Response.default_charset = “utf-8”`

* In below test we are passing `ActionDispatch::Response.default_charset = 'utf-16’` so name of the test is irrelevant — “read content type without charset”
2015-10-02 01:27:23 +05:30