Commit Graph

57740 Commits

Author SHA1 Message Date
Jeremy Daer
ab56c92f3c
Merge pull request #23461 from kamipo/prepared_statements_for_mysql2_adapter
Add prepared statements support for `Mysql2Adapter`
2016-04-23 22:28:52 -07:00
Guillermo Iguaran
65d743904c Merge pull request #24701 from prathamesh-sonpatki/deprecate-request_via_redirect
Deprecate `request_via_redirect` method.
2016-04-24 00:04:26 -05:00
Jeremy Daer
7c45fa57a1
Merge pull request #24708 from kamipo/move_select_rows_implementation_to_super_class
Move `select_rows` implementation to super class
2016-04-23 21:26:33 -07:00
Guillermo Iguaran
77cd14bbbf Merge pull request #24705 from kamipo/add_nodoc_to_insert_versions_sql
Add `:nodoc:` to `insert_versions_sql` [ci skip]
2016-04-23 22:52:47 -05:00
Guillermo Iguaran
9f8a6c47c8 Merge pull request #24706 from kamipo/remove_in_doc_about_mysql_versions_below_5
Remove in the doc about MySQL versions below 5 [ci skip]
2016-04-23 22:50:26 -05:00
Guillermo Iguaran
77f3617362 Merge pull request #24707 from kamipo/move_require_ipaddr_to_oid_cidr
Move `require 'ipaddr'` in `postgresql/oid/cidr.rb`
2016-04-23 22:47:50 -05:00
Ryuta Kamizono
c1ab4a2dbf Move select_rows implementation to super class 2016-04-24 11:20:46 +09:00
Ryuta Kamizono
9c8a086863 Move require 'ipaddr' in postgresql/oid/cidr.rb
`IPAddr` is used in `OID::Cidr`.
2016-04-24 11:09:08 +09:00
Ryuta Kamizono
7ec31ac429 Remove in the doc about MySQL versions below 5 [ci skip]
Follow up to #23458.
Active Record supports MySQL >= 5.0 now.
2016-04-24 11:02:30 +09:00
Ryuta Kamizono
5394f2cde8 Add :nodoc: to insert_versions_sql [ci skip]
Follow up to #24685. `insert_versions_sql` is not public API.
2016-04-24 10:54:53 +09:00
Prathamesh Sonpatki
3da0a2b065
Deprecate request_via_redirect method.
- Followup of https://github.com/rails/rails/issues/18693.
- I think we missed deprecating `request_via_redirect` in that pull
  request.
- Originally requested by DHH here
  https://github.com/rails/rails/issues/18333.
2016-04-24 07:18:11 +05:30
प्रथमेश Sonpatki
39f1dac9a5 Merge pull request #24704 from graemeboy/master
Fix typo in ActiveJob #retry_job doc
2016-04-24 07:15:07 +05:30
Graeme Boy
6e27481dc7 Fix typo in ActiveJob #retry_job doc 2016-04-23 17:23:19 -07:00
Sean Griffin
17668cf528 Merge pull request #24703 from vipulnsward/24695-handle-nils
Followup of #15771
2016-04-23 17:27:09 -06:00
Vipul A M
210729c4cc Followup of #15771
Make sure we handle explicitly passed nil's to lock_version as well.
An explicitly passed nil value is now converted to 0 on LockingType,
so that we don't end up with ActiveRecord::StaleObjectError in update record
optimistic locking

Fixes #24695
2016-04-24 04:01:18 +05:30
Jeremy Daer
aa598f4f39
Share lock: avoid livelock due to exclusive thread sleeping before waiting threads wake 2016-04-23 15:19:25 -07:00
Andrew White
cc7bd7cc39 Merge pull request #24699 from vipulnsward/to_time_cleanup
Follow up of https://github.com/rails/rails/commit/c9c5788a527b70d7f9
2016-04-23 20:57:41 +01:00
Vipul A M
abeabdbc88 Follow up of c9c5788a52
[ci skip]
2016-04-24 01:18:15 +05:30
Andrew White
ee5e476aad Make getlocal and getutc always return instances of Time
Previously these methods could return either a DateTime or a Time
depending on how the ActiveSupport::TimeWithZone instance had
been constructed. Changing to always return an instance of Time
eliminates a possible stack level too deep error in to_time where
it was wrapping a DateTime instance.

As a consequence of this the internal time value is now always an
instance of Time in the UTC timezone, whether that's as the UTC
time directly or a representation of the local time in the timezone.

There should be no consequences of this internal change and if
there are it's a bug due to leaky abstractions.
2016-04-23 19:34:54 +01:00
Andrew White
a424bbb242 Add DateTime#subsec
Mirrors the Time#subsec method by returning the fraction
of the second as a Rational.
2016-04-23 19:18:38 +01:00
Andrew White
88d844b278 Change Time#sec_fraction to use subsec
Time instances can have fractional parts smaller than a nanosecond.
2016-04-23 19:11:34 +01:00
Andrew White
dbc7a7cb50 Add additional aliases for DateTime#utc 2016-04-23 18:01:38 +01:00
Andrew White
229737e8f3 Add CHANGELOG entry for #24700 2016-04-23 17:17:36 +01:00
Andrew White
7fb2a63708 Add Time#sec_fraction
Mirrors the DateTime#sec_fraction method by returning the fraction
of the second as a Rational.
2016-04-23 17:15:26 +01:00
Andrew White
f5dcc141ec Merge pull request #24700 from yui-knk/refactor_localtime
Move `DateTime#getlocal` to `/core_ext/date_time/calculations.rb`
2016-04-23 16:27:37 +01:00
yui-knk
941eee5c8e Move DateTime#getlocal to /core_ext/date_time/calculations.rb
`DateTime#getlocal` is newly added public API.
It's responsible is same as `DateTime#utc`, so `calculations.rb` is
a best plase to define this method.
For keeping consistency with `DateTime#utc`, defines `#localtime` and
defines `getlocal` as an alias method.
2016-04-23 23:51:49 +09:00
Andrew White
c9c5788a52 Add compatibility for Ruby 2.4 to_time changes
In Ruby 2.4 the `to_time` method for both `DateTime` and `Time` will
preserve the timezone of the receiver when converting to an instance
of `Time`. Since Rails 5.0 will support Ruby 2.2, 2.3 and later we
need to introduce a compatibility layer so that apps that upgrade do
not break. New apps will have a config initializer file that defaults
to match the new Ruby 2.4 behavior going forward.

For information about the changes to Ruby see:
https://bugs.ruby-lang.org/issues/12189
https://bugs.ruby-lang.org/issues/12271

Fixes #24617.
2016-04-23 15:03:50 +01:00
Vipul A M
1ffa1a852e Merge pull request #24697 from tomkadwill/action_pack_typos_2
Actionpack documentation typos [ci skip]
2016-04-23 19:03:28 +05:30
Tom Kadwill
51a2f7bb67 Actionpack documentation typos [ci skip] 2016-04-23 14:24:10 +01:00
Jeremy Daer
4c76ce6404
Schema load: Fix dupe version insert
Re. 6e098284e97250eaed6f30f5c7c362d87da986b0
2016-04-22 18:32:47 -07:00
Arthur Nogueira Neves
00b2cbad7c Merge pull request #24693 from vipulnsward/fix-test-name
Fix test name
2016-04-22 17:19:05 -07:00
Vipul A M
5ffe291b9c Fix test name 2016-04-23 04:37:43 +05:30
Jeremy Daer
a14c811026
Merge pull request #24685 from vipulnsward/sqlite-compat-for-multi-insert
Gracefully fallback on version migrations for sqlite < 3.7.11
2016-04-22 15:33:59 -07:00
Vipul A M
6e098284e9 42dd2336b3 changed INSERT INTO versions to run in 1 single query.
This breaks for sqlite versions < 3.7.11, which is especially the case on Ubuntu 12.04 LTS, that has SQLite version 3.7.9 as default.

So we check for support for multi insert, before performing single query inserts, else fallback to older version of running multiple queries.
[Vipul A M & Yasuo Honda]
2016-04-23 03:18:13 +05:30
Sean Griffin
1ca6f7f767 Do not attempt to return connection with open transaction to pool (#24610)
When the query cache completes, if Active Record is still inside of a
transaction, it is because the transaction is meant to be left open
above this unit of work (such as transactional fixtures in tests). There
were several tests around the behavior of "tests" that were invalid, as
tests are not run through the executor. They have been changed to
reflect the new behavior, which is closer to what actually occurs in
Rails tests.

Fixes #23989
Fixes #24491
Close #24500
2016-04-22 12:56:43 -06:00
Aaron Patterson
4a06cc9edd
fix boot performance issue
Slight refactor to improve boot performance on some Ruby
implementations (for now).
2016-04-22 09:17:05 -07:00
Vipul A M
aa804b152f Merge pull request #24686 from javiervidal/broken-links-in-3-0-releases-notes
Fix broken links in 'Ruby on Rails 3.0 Release Notes' [ci skip]
2016-04-22 18:18:08 +05:30
Javier Vidal
29bf30561f Fix broken links in 'Ruby on Rails 3.0 Release Notes' [ci skip] 2016-04-22 14:45:52 +02:00
Vipul A M
8e7715ae31 Change definition of what async means for an Active Job Job [ci skip]
Change definition of what async means for an Active Job Job [ci skip]
2016-04-22 15:35:35 +05:30
Mohit Natoo
23f472ae7c - [ci skip] Active Job Async doesn't support to Async feature as per it's definition.
- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.

- [ci skip] Active Job Async doesn't support to Async feature as per it's definition.
2016-04-22 15:37:20 +05:30
Richard Schneeman
2700a1aa43 Merge pull request #24681 from tcopeland/not_example_can_demonstrate_inequality
Combine inequality and equality and add SQL examples [ci skip]
2016-04-21 17:14:10 -05:00
Tom Copeland
e1a31f51f4 Add SQL examples for equality and NOT [ci skip] 2016-04-21 17:19:45 -04:00
Vipul A M
f0a2edc7fc Merge pull request #24669 from tomkadwill/action_pack_typos
Actioncable and Actionpack documentation typos [ci skip]
2016-04-22 02:07:29 +05:30
Tom Kadwill
5646895b7f Actioncable and Actionpack documentation typos [ci skip] 2016-04-21 21:32:06 +01:00
Xavier Noria
9311afcbe8 just say nothing about why this regexp is slower [ci skip]
Further investigation seems to disprove that backtracking is the
reason why the positive variant is slower, see

    https://github.com/rails/rails/pull/24658#issuecomment-213079710

so, just say nothing about it, only assert it is slower.
2016-04-21 21:59:50 +02:00
Kasper Timm Hansen
5d4a023cdb Merge pull request #24680 from mohitnatoo/rake-dev-cache
using rails dev:cache instead of rake dev:cache
2016-04-21 21:30:58 +02:00
Mohit Natoo
a83a2b57aa - using rails dev:cache instead of rake dev:cache 2016-04-22 01:01:23 +05:30
Jeremy Daer
2080bfdb16
Merge pull request #24676 from vipulnsward/log-ac-failed-states
Log if redis connection is in stale/failed state.
2016-04-21 11:20:11 -07:00
Sean Griffin
1f47c4b0df Make file update checker tests more resilient on Windows
Without the `wdm` gem, it appears that `listen` keeps an open handle to
each of these files, causing them not to be removed when the tempdir
tries to clean iteslf up, and then directory to fail to unlink. In
addition to fixing that particular failure, we now construct OS agnostic
paths, and capture exceptions if the directory fails to unlink so that
minitest will report it rather than crash
2016-04-21 10:54:54 -06:00
Vipul A M
e7f921d405 Log if redis connection is in stale/failed state. 2016-04-21 22:13:55 +05:30