Commit Graph

60154 Commits

Author SHA1 Message Date
Rafael França
1dcfe98235 Merge pull request #27074 from maclover7/jm-jruby-actionmailer
Enable JRuby testing for Action Mailer
2016-11-16 17:43:11 -05:00
Jon Moss
780aaf1f10 Enable JRuby testing for Action Mailer
All tests passing locally for me:

```
195 runs, 441 assertions, 0 failures, 0 errors, 0 skips
```
2016-11-16 17:23:10 -05:00
Yves Senn
3b2346ea13 docs, add update_all example with SQL fragment. [ci skip]
The relation method `update_all` allows you to pass a SQL fragment. The
functionality is already mentioned in the prose but the examples section
does not cover it.
2016-11-16 08:52:49 +01:00
Guillermo Iguaran
c2c6b7be23 Merge pull request #27056 from kirs/fix-testing-isolation
Fix testing isolation
2016-11-15 22:05:14 -05:00
Jon Moss
bce3d1f8c0 Merge pull request #27058 from maclover7/jm-fix-26904
Support AC::Parameters for PG HStore
2016-11-15 17:12:08 -05:00
Jon Moss
0a8b212db7 Support AC::Parameters for PG HStore
As reported via #26904, there is a regression in how values for
Postgres' HStore column type are being processed, beginning in Rails 5.
Currently, the way that Active Record checks whether or not values need
to be serialized and put into the correct storage format is whether or
not it is a `Hash` object. Since `ActionController::Parameters` no
longer inherits from `Hash` in Rails 5, this conditional now returns
false. To remedy this, we are now checking to see whether the `value`
parameters being passed in responds to a certain method, and then
calling the `serialize` method, except this time with a real Hash
object. Keeping things DRY!

Fixes #26904.
2016-11-15 16:42:44 -05:00
Kir Shatrov
3261470452 Fix testing isolation
AS::Testing::Isolation has two ways to isolate the process:
forking and subprocessing. The second way is used on JRuby and other
platforms that don't support forking.

The way how subprocessing works is that we prepare a command to run a
new process:

```
/opt/rubies/2.3.0/bin/ruby -I{skipped_load_path} test/initializable_test.rb '' -nInitializableTests::Basic#test_Initializer_provides_context's_class_name
```

As you see, there's unescaped quote at the end of the line.
It leads to:

```
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
```

This fixes tests on MRI + NO_FORK variable and on JRuby 🎉
2016-11-15 15:56:32 -05:00
Sean Griffin
6e692e6e5b Merge pull request #27054 from kamipo/null_relation_calculate
Refactor `NullRelation#calculate`
2016-11-15 13:25:51 -05:00
Ryuta Kamizono
7c1b14f041 Refactor NullRelation#calculate
Before:

```ruby
    def calculate(operation, _column_name)
      if [:count, :sum].include? operation
        group_values.any? ? Hash.new : 0
      elsif [:average, :minimum, :maximum].include?(operation) && group_values.any?
        Hash.new
      else
        nil
      end
    end
```

After:

```ruby
    def calculate(operation, _column_name)
      case operation
      when :count, :sum
        group_values.any? ? Hash.new : 0
      when :average, :minimum, :maximum
        group_values.any? ? Hash.new : nil
      end
    end
```
2016-11-16 02:42:24 +09:00
Akira Matsuda
3a558aa2bc Make sure to bundle json 2.x on CI
Without this, bundler tries to bundle json 1.8 on Ruby 2.4 in some cases
https://travis-ci.org/rails/rails/jobs/175874852
2016-11-15 09:26:03 +09:00
प्रथमेश Sonpatki
a4208bb974 Merge pull request #27048 from y-yagi/remove_alias_method_chain_from_guide
remove `alias_method_chain` from guide [ci skip]
2016-11-15 05:35:39 +05:30
yuuji.yaginuma
eda23fa62f remove alias_method_chain from guide [ci skip]
Follow up to 7c848e6dd493ff236d33a0410a92f4c3e5cc3c7f
2016-11-15 08:42:02 +09:00
Rafael França
fa767bbe0f Merge pull request #27047 from y-yagi/remove_duplicated_entry
remove duplicated changelog entry [ci skip]
2016-11-14 17:46:47 -05:00
yuuji.yaginuma
7d1e104f66 remove duplicated changelog entry [ci skip] 2016-11-15 07:43:21 +09:00
Jon Moss
cfa5cab3a8 Merge pull request #27046 from conradbeach/fix-typo-layouts-and-rendering-guide
Fix small typo in Layouts and Rendering guide.
2016-11-14 16:11:29 -05:00
Conrad Beach
b8341b3a2a Fix small typo in Layouts and Rendering guide. [ci skip]
Changed "same way they do" to "same way they are".
2016-11-14 14:07:21 -07:00
Akira Matsuda
013745151b Missing require string/filters for squish 2016-11-15 06:02:25 +09:00
Andrew White
e491b2c063 Merge pull request #27035 from rails/remove-active-support-deprecations
Remove Active Support deprecations
2016-11-14 19:59:43 +00:00
Rafael França
3a82ad746a Merge pull request #27040 from ttanimichi/add-skip-sprockets-to-passthrough-options
Add `:skip_sprockets` to `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`
2016-11-14 14:34:31 -05:00
Rafael Mendonça França
ee93787580
Fix style violations 2016-11-14 13:18:31 -05:00
Rafael Mendonça França
7c1566b278
Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string"
This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing
changes made to 2384317465ccb1dfca456a2b7798714b99f32711.

Reason: Adding a new option in the API for something that can be done
with a `#presence` check could do.
2016-11-14 13:16:00 -05:00
Andrew White
0d7bd2031b Remove deprecated class ActiveSupport::Concurrency::Latch 2016-11-14 12:44:19 +00:00
Andrew White
0189f4db6f Remove deprecated separator argument from parameterize 2016-11-14 12:14:23 +00:00
Andrew White
90520d2eee Remove deprecated method Numeric#to_formatted_s 2016-11-14 12:03:48 +00:00
Andrew White
7c848e6dd4 Remove deprecated method alias_method_chain 2016-11-14 11:57:30 +00:00
Tsukuru Tanimichi
592c06d7cb Add :skip_sprockets to Rails::PluginBuilder::PASSTHROUGH_OPTIONS
`rails plugin new` with `--full` and `--skip-sprockets` options generates a dummy application that throws `NoMethodError`.

```
% rails plugin new my_engine -S --full --skip-gemspec
% cd my_engine
% bin/rails test
rails aborted!
NoMethodError: undefined method `assets' for #<Rails::Application::Configuration:0x007f83aa1e6100>
```
2016-11-14 20:56:49 +09:00
Andrew White
8e43fc5ace Remove deprecated constant MissingSourceFIle 2016-11-14 11:25:52 +00:00
Andrew White
b93a257186 Remove deprecated Module.qualified_const_get/set/defined? 2016-11-14 08:11:21 +00:00
Rafael Mendonça França
5f32221559
Merge pull request #27007 from maclover7/jm-fix-26912
Don't error on an empty CONTENT_TYPE
2016-11-13 23:09:08 -05:00
Rafael França
f1c5b0bd0a Merge pull request #26222 from vipulnsward/26134-fix
Format and send logs to logger.fatal from DebugExceptions
2016-11-13 22:50:30 -05:00
Rafael França
2a8426c0f6 Merge pull request #27030 from kamipo/avoid_build_preloader
Avoid `build_preloader` if preloading is not needed
2016-11-13 22:40:46 -05:00
Matthew Draper
72717e68af Merge pull request #27037 from kamipo/call_spawn_and_bang_method_for_none
Call `spawn` and bang method for `none`
2016-11-13 22:06:07 -05:00
Ryuta Kamizono
fd7ca6ebca Call spawn and bang method for none
All query methods calls `spawn` and bang method, but only `none` is not.
2016-11-14 11:32:33 +09:00
Rafael França
c163d93f94 Merge pull request #26928 from kamipo/fix_name_error_2
Fix NameError: undefined local variable or method `result`
2016-11-13 20:11:47 -05:00
Ryuta Kamizono
8be9c710f6 Fix NameError: undefined local variable or method result
Caused by 007e50d8e5a900547471b6c4ec79d9d217682c5d.

https://github.com/rails/rails/pull/26925 was closed in favor of dcb364e.
But dcb364e is only fixed sqlite3 adapter and still broken mysql2
adapter with `prepared_statements: true` (`exec_stmt_and_free`).

```diff
diff --git a/activerecord/test/config.example.yml b/activerecord/test/config.example.yml
index 58e2d45..7b3c1a6 100644
--- a/activerecord/test/config.example.yml
+++ b/activerecord/test/config.example.yml
@@ -56,9 +56,11 @@ connections:
       username: rails
       encoding: utf8
       collation: utf8_unicode_ci
+      prepared_statements: true
     arunit2:
       username: rails
       encoding: utf8
+      prepared_statements: true

   oracle:
      arunit:
```

```
% be rake test_mysql2 --verbose
...
Using mysql2
/Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb:90: warning: assigned but unused variable - result
/Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql/database_statements.rb:101:in `block in exec_stmt_and_free': NameError: undefined local variable or method `result' for #<ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x007fe2c50eb140>: SELECT  `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = ? LIMIT ? (ActiveRecord::StatementInvalid)
        from /Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:586:in `block in log'
...
```
2016-11-14 10:07:43 +09:00
Rafael França
087921af29 Merge pull request #27033 from vipulnsward/fix-bignum-warning
Remove warning from Bignum constant access
2016-11-13 19:58:52 -05:00
Rafael França
f3aff3ecb1 Merge pull request #27036 from y-yagi/update_turbolinks_example
use correct value in example [ci skip]
2016-11-13 19:50:00 -05:00
yuuji.yaginuma
7c7f4f96df use correct value in example [ci skip]
Need to specify `reload` from turbolinks 5.
Ref: 7225f0bb9fd1d71a7a37b53815c90178cc7319bd
2016-11-14 09:45:28 +09:00
Andrew White
213f0d63a5 Update CHANGELOG 2016-11-13 23:25:05 +00:00
Andrew White
dadba9ae57 Remove deprecated :prefix option 2016-11-13 23:09:03 +00:00
Andrew White
2ff2b98032 Remove deprecated new_from_hash_copying_default 2016-11-13 23:09:03 +00:00
Andrew White
0e8d297301 Remove deprecated time marshal core_ext file 2016-11-13 23:09:03 +00:00
Andrew White
73b18eccdf Remove deprecated struct core_ext file 2016-11-13 23:09:02 +00:00
Vipul A M
546ff50d82
Remove warning from access to Bignum class, 2**64 is already a known bignum value. See also http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum for smallest bignum value 2016-11-13 18:08:57 -05:00
Andrew White
2ae41d24b9 Remove deprecated module method_transplanting file 2016-11-13 22:29:18 +00:00
Andrew White
c32ccd837e Remove deprecated local_constants 2016-11-13 22:28:18 +00:00
Andrew White
c9458c74e0 Remove deprecated kernel debugger file 2016-11-13 22:27:52 +00:00
Andrew White
3641cd3f3d Remove deprecated namespaced_key 2016-11-13 22:17:37 +00:00
Andrew White
8b646041be Remove deprecated set_cache_value 2016-11-13 22:16:54 +00:00
Andrew White
efdb785d7f Remove deprecated escape_key 2016-11-13 22:15:45 +00:00