Commit Graph

53415 Commits

Author SHA1 Message Date
Kasper Timm Hansen 44cff3045c Merge pull request #21746 from amitsuroliya/doc_fixes
Improve readability of docs by using code tag [ci skip]
2015-09-24 14:38:15 +02:00
amitkumarsuroliya 4a2bac24aa Improve readability of docs by using code tag [ci skip] 2015-09-24 17:57:37 +05:30
Yves Senn 8516d76c62 Merge pull request #21740 from cllns/add-jbuilder-notes
[ci skip]

[Action View Overview Guide] Add note about Jbuilder
2015-09-24 08:38:17 +02:00
Yves Senn c5481d8af3 Merge pull request #21744 from amitsuroliya/doc_changes
Fix ActiveRecord `instance_method_already_implemented` docs [ci skip]
2015-09-24 08:29:04 +02:00
Yves Senn 311d96b9e4 Merge pull request #21745 from brandoncc/patch-1
Fix out of sync comment [ci skip]
2015-09-24 08:27:30 +02:00
Brandon Conway ca4f1e0440 Fix out of sync comment
It appears that as of version 4 the `db:test:prepare` task no longer depends on the `abort_if_pending_migrations` task, which leaves this comment out of sync.
2015-09-23 23:04:24 -07:00
amitkumarsuroliya 2629d61ad8 Fix ActiveRecord `instance_method_already_implemented` docs [ci skip] 2015-09-24 08:15:42 +05:30
Aaron Patterson 10762e9e55 call `get` instead of controller.process
we want the request to go through the test harness, not directly call
the methods on the controller
2015-09-23 16:44:00 -07:00
Aaron Patterson 208956c0d0 remove controller construction
also remove req / res references
2015-09-23 16:42:15 -07:00
Aaron Patterson 85ab2e7328 stop directly referencing the request and response objects 2015-09-23 16:40:56 -07:00
Aaron Patterson f150edb640 test framework allocates the controller for us 2015-09-23 16:01:11 -07:00
Aaron Patterson 53549a7585 type of response should not matter 2015-09-23 16:00:38 -07:00
Aaron Patterson b5e36dd00a don't touch the response object until after we call `get` 2015-09-23 15:59:32 -07:00
Aaron Patterson d175ab2bd6 stop directly setting headers on the controller
again, since we are going through the test harness, all this is done
for us.
2015-09-23 15:48:02 -07:00
Aaron Patterson f679397634 stop constructing a request object in this setter
Since we just go through the normal test harness that sets up a request
for us, we don't need to do this anymore.
2015-09-23 15:48:01 -07:00
Aaron Patterson 4f7dbf50d9 test against controller responses
rather than calling methods on the controller.  We should test the
values returned by the controller rather than assuming that the
internals are implemented in a certain way.
2015-09-23 15:48:01 -07:00
Aaron Patterson e16afe61ab stop applying default headers in ActionDispatch::Response
I'm making this change so that I can construct response objects that
*don't* have the default headers applied.  For example, I would like to
construct a response object from the return value of a controller.

If you need to construct a response object with the default headers,
then please use the alternate constructor:
`ActionDispatch::Response.create`
2015-09-23 15:48:01 -07:00
Eileen M. Uchitelle 28cb10b15e Merge pull request #21737 from cllns/make-engine-paths-consistent
Change the paths for both Gemfile lines to be 'engines/blorgh'
2015-09-23 18:37:28 -04:00
Sean Griffin e19f1c3f71 Merge pull request #21742 from vngrs/fix_ar_locking_doc
Fix ActiveRecord::Locking doc [ci skip]
2015-09-23 15:35:13 -06:00
Mehmet Emin İNAÇ 8873a6f2ca Fix ActiveRecord::Locking doc [ci skip] 2015-09-24 00:33:43 +03:00
Kasper Timm Hansen 9c55ff564d Merge pull request #21218 from repinel/fix-as-callback-terminator
WIP: Fix the AS::Callbacks terminator regression from 4.2.3
2015-09-23 22:18:33 +02:00
Kasper Timm Hansen 262f92364b Merge pull request #21736 from eliotsykes/document-bearer-prefix
Document Bearer prefix for Authorization header [ci skip]
2015-09-23 22:14:43 +02:00
Kasper Timm Hansen 5c30e86dc4 Merge pull request #21721 from ronakjangir47/remove_mocha_railties_app_generator
Removed Mocha from app generators tests
2015-09-23 22:10:50 +02:00
Sean Collins 961779997c Add note about Jbuilder
[skip ci]
2015-09-23 13:57:52 -06:00
Sean Griffin c6b30d2219 Merge pull request #21739 from ronakjangir47/subsecond_precision_supported
skipped assertion on datetime seconds precision as it is only valid for newer mysql verions
2015-09-23 13:11:14 -06:00
Aaron Patterson db1d4d31c9 don't access the response object before a request was made
It doesn't make sense to access the response object before a request is
made (how was a response object created without making a request?)  This
commit splits testing default headers and default header mutation tests
and removes access to the pre-request response object.
2015-09-23 12:08:32 -07:00
Ronak Jangir df3a3b37de skipped assertion on datetime seconds precision as it is only valid for newer mysql versions 2015-09-24 00:35:50 +05:30
Sean Collins 11f00fd3e3 Change the paths for both Gemfile lines to be 'engines/blorgh'
They're now consistent.

Also changes the quotes to be single, so we only have one type of quote per line

[skip ci]
2015-09-23 12:29:17 -06:00
Aaron Patterson 39df51e171 split cookie tests
these should really be multiple tests.
2015-09-23 11:25:33 -07:00
Aaron Patterson 4cf449df91 don't mutate a response object after to_a
When the response object is `to_a`'d, that means it's been written to
the socket.  It doesn't make sense to mutate the response object after
it's been written (and this may raise an exception in the future).
2015-09-23 11:23:22 -07:00
Ronak Jangir d1a35c35d5 Removed Mocha from app generators tests 2015-09-23 23:36:25 +05:30
Eliot Sykes 619481559d Document Bearer prefix for Authorization header [ci skip] 2015-09-23 18:00:41 +01:00
Sean Griffin f860ab3f14 Further remove reliance on subsecond precision in tests 2015-09-23 09:43:19 -06:00
Sean Griffin 05436172db Don't rely on subsecond precision being applied in tests
When I originally reviewed the #20317, I believe these changes were
present, but it appears that it was later updated so that they were
removed. Since Travis hadn't re-run the build, this slipped through.
2015-09-23 09:33:43 -06:00
Sean Griffin 2c7d0d42ac 0 precision is not the same as no precision
And we are passing them as separate types in the query, which means 0
precision is still not supported by older versions of MySQL. I also
missed a handful of other cases where they need to be conditionally
applied.
2015-09-23 09:15:59 -06:00
Sean Griffin f696494aed Don't attempt to specify datetime precision unless supported
Specifically, versions of MySQL prior to 5.6 do not support this, which
is what's used on Travis by default. The method `mysql_56?` appeared to
only ever be used to conditionally apply subsecond precision, so I've
generalized it and used it more liberally.

This should fix the test failures caused by #20317
2015-09-23 09:09:50 -06:00
Sean Griffin 66337b62ad Merge pull request #20317
AR: take precision into count when assigning a value to timestamp
attribute
2015-09-23 09:01:38 -06:00
Bogdan Gusiev d03f519665 Fixed taking precision into count when assigning a value to timestamp attribute
Timestamp column can have less precision than ruby timestamp
In result in how big a fraction of a second can be stored in the
database.

  m = Model.create!
  m.created_at.usec == m.reload.created_at.usec
    # => false
    # due to different seconds precision in Time.now and database column

If the precision is low enough, (mysql default is 0, so it is always low
enough by default) the value changes when model is reloaded from the
database. This patch fixes that issue ensuring that any timestamp
assigned as an attribute is converted to column precision under the
attribute.
2015-09-23 13:29:08 +03:00
Abdelkader Boudih f5fe01e836 Merge pull request #21732 from amitsuroliya/mime_docs
Updated Mime Negotiations docs [ci skip]
2015-09-23 11:26:55 +02:00
amitkumarsuroliya 96eece6cb4 Updated Mime Negotiations docs [ci skip]
As we all know that Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
2015-09-23 14:52:27 +05:30
Kasper Timm Hansen 1e9593a37c Merge pull request #21729 from y-yagi/fix_warning_in_ar
remove warning from Calculations#sum
2015-09-23 09:07:20 +02:00
yuuji.yaginuma 908d68718d remove warning from Calculations#sum
This removes the following warning.
```
activerecord/lib/active_record/relation/calculations.rb:74: warning: `&' interpreted as argument prefix
```
2015-09-23 15:19:56 +09:00
Andrew White ef7791ca14 Merge pull request #21723 from y-yagi/fix_deprecate_msg_in_mailers_controller
stop using deprecated method in mailers controller
2015-09-23 05:31:43 +01:00
Rafael Mendonça França 7c08e1ac6d Merge pull request #21725 from yui-knk/fix/ar_sum
Fix arguments of `AR::Calculations#sum`
2015-09-23 01:18:42 -03:00
Sean Griffin 624253f1d1 Merge pull request #21728 from cllns/fix-engine-path
Remove leading slash from path
2015-09-22 22:14:44 -06:00
Sean Griffin 4a7c82d206 Merge pull request #21727 from yui-knk/fix/remove_unused_args
Remove not used argument `table_name` of `sanitize_sql_for_conditions`
2015-09-22 22:13:24 -06:00
Sean Collins 1b9e2bc5aa Remove leading slash from path
The leading slash denotes an absolute path,
rather than a relative one (which is more popular)

[ci skip]
2015-09-22 22:05:06 -06:00
yui-knk f37db17345 Remove not used argument `table_name` of `sanitize_sql_for_conditions`
This argument was needen when `sanitize_sql_for_conditions` internally
called `sanitize_sql_hash_for_conditions`.
But `sanitize_sql_hash_for_conditions` was deprecated
(eb921000a1)
and deleted
(3a59dd2123)
(4bd089f1d9).
2015-09-23 11:37:37 +09:00
Roque Pinel 35cd365621 Fix the AS::Callbacks terminator regression from 4.2.3
Rails 4.2.3 AS::Callbacks will not halt chain if `false` is returned.
That is the behavior of specific callbacks like AR::Callbacks and
AM::Callbacks.
2015-09-22 22:32:56 -04:00
Sean Griffin eb52c8979b Merge pull request #21726 from yui-knk/test/named_bind_arity
Add tests for sanitize named bind arity
2015-09-22 20:21:55 -06:00