Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/4-2-stable' into backport-integer
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Aug 16, 2016
2 parents d096b8f + e5253b3 commit 8e7f6a6
Show file tree
Hide file tree
Showing 59 changed files with 616 additions and 190 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
@@ -1,11 +1,7 @@
language: ruby
sudo: false
script: 'ci/travis.rb'
#FIXME: Remove bundler uninstall on Travis when https://github.com/bundler/bundler/issues/4493 is fixed.
before_install:
- rvm @global do gem uninstall bundler --all --ignore-dependencies --executables
- rvm @global do gem install bundler -v '1.11.2'
- bundle --version
- "rvm current | grep 'jruby' && export AR_JDBC=true || echo"
- "rm ${BUNDLE_GEMFILE}.lock"
before_script:
Expand Down
62 changes: 31 additions & 31 deletions Gemfile.lock
Expand Up @@ -14,55 +14,55 @@ GIT
PATH
remote: .
specs:
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
actionmailer (4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
actionpack (4.2.7)
actionview (= 4.2.7)
activesupport (= 4.2.7)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.6)
activesupport (= 4.2.6)
actionview (4.2.7)
activesupport (= 4.2.7)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.6)
activesupport (= 4.2.6)
activejob (4.2.7)
activesupport (= 4.2.7)
globalid (>= 0.3.0)
activemodel (4.2.6)
activesupport (= 4.2.6)
activemodel (4.2.7)
activesupport (= 4.2.7)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
activerecord (4.2.7)
activemodel (= 4.2.7)
activesupport (= 4.2.7)
arel (~> 6.0)
activesupport (4.2.6)
activesupport (4.2.7)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
rails (4.2.7)
actionmailer (= 4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
activemodel (= 4.2.7)
activerecord (= 4.2.7)
activesupport (= 4.2.7)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.6)
railties (= 4.2.7)
sprockets-rails
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
railties (4.2.7)
actionpack (= 4.2.7)
activesupport (= 4.2.7)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)

Expand Down Expand Up @@ -214,7 +214,7 @@ GEM
thread
sprockets (3.0.3)
rack (~> 1.0)
sprockets-rails (3.0.4)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
Expand Down Expand Up @@ -295,4 +295,4 @@ DEPENDENCIES
w3c_validators

BUNDLED WITH
1.11.2
1.12.5
2 changes: 1 addition & 1 deletion RAILS_VERSION
@@ -1 +1 @@
4.2.6
4.2.7.1
2 changes: 2 additions & 0 deletions actionmailer/CHANGELOG.md
@@ -1,3 +1,5 @@
## Rails 4.2.7 (July 12, 2016) ##

* Removes `-t` from default Sendmail arguments to match the underlying
`Mail::Sendmail` setting.

Expand Down
4 changes: 2 additions & 2 deletions actionmailer/lib/action_mailer/gem_version.rb
Expand Up @@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 6
PRE = nil
TINY = 7
PRE = "1"

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
Expand Down
5 changes: 5 additions & 0 deletions actionpack/CHANGELOG.md
@@ -1,3 +1,8 @@
## Rails 4.2.7 (July 12, 2016) ##

* No changes.


## Rails 4.2.6 (March 07, 2016) ##

* No changes.
Expand Down
4 changes: 2 additions & 2 deletions actionpack/lib/action_pack/gem_version.rb
Expand Up @@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 6
PRE = nil
TINY = 7
PRE = "1"

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
Expand Down
43 changes: 43 additions & 0 deletions actionpack/test/dispatch/request/json_params_parsing_test.rb
Expand Up @@ -84,7 +84,50 @@ def teardown
end
end

test "prevent null query" do
# Make sure we have data to find
klass = Class.new(ActiveRecord::Base) do
def self.name; 'Foo'; end
establish_connection adapter: "sqlite3", database: ":memory:"
connection.create_table "foos" do |t|
t.string :title
t.timestamps null: false
end
end
klass.create
assert klass.first

app = ActionDispatch::ParamsParser.new ->(env) {
request = ActionDispatch::Request.new env
params = ActionController::Parameters.new request.parameters
if params[:t]
klass.find_by_title(params[:t])
else
nil
end
}

assert_nil app.call(make_env({ 't' => nil }))
assert_nil app.call(make_env({ 't' => [nil] }))

[[[nil]], [[[nil]]]].each do |data|
assert_deprecated do
assert_nil app.call(make_env({ 't' => data }))
end
end
end

private
def make_env json
data = JSON.dump json
content_length = data.length
{
'CONTENT_LENGTH' => content_length,
'CONTENT_TYPE' => 'application/json',
'rack.input' => StringIO.new(data)
}
end

def assert_parses(expected, actual, headers = {})
with_test_routing do
post "/parse", actual, headers
Expand Down
5 changes: 5 additions & 0 deletions actionview/CHANGELOG.md
@@ -1,3 +1,8 @@
## Rails 4.2.7 (July 12, 2016) ##

* No changes.


## Rails 4.2.6 (March 07, 2016) ##

* Fix stripping the digest from the automatically generated img tag alt
Expand Down
4 changes: 2 additions & 2 deletions actionview/lib/action_view/gem_version.rb
Expand Up @@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 6
PRE = nil
TINY = 7
PRE = "1"

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
Expand Down
4 changes: 2 additions & 2 deletions actionview/lib/action_view/helpers/tag_helper.rb
Expand Up @@ -179,9 +179,9 @@ def tag_option(key, value, escape)
if value.is_a?(Array)
value = escape ? safe_join(value, " ") : value.join(" ")
else
value = escape ? ERB::Util.unwrapped_html_escape(value) : value
value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s
end
%(#{key}="#{value}")
%(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
end
end
end
Expand Down
18 changes: 18 additions & 0 deletions actionview/test/template/tag_helper_test.rb
Expand Up @@ -29,6 +29,14 @@ def test_tag_options_accepts_blank_option
assert_equal "<p included=\"\" />", tag("p", :included => '')
end

def test_tag_options_accepts_symbol_option_when_not_escaping
assert_equal "<p value=\"symbol\" />", tag("p", { value: :symbol }, false, false)
end

def test_tag_options_accepts_integer_option_when_not_escaping
assert_equal "<p value=\"42\" />", tag("p", { value: 42 }, false, false)
end

def test_tag_options_converts_boolean_option
assert_dom_equal '<p disabled="disabled" itemscope="itemscope" multiple="multiple" readonly="readonly" allowfullscreen="allowfullscreen" seamless="seamless" typemustmatch="typemustmatch" sortable="sortable" default="default" inert="inert" truespeed="truespeed" />',
tag("p", :disabled => true, :itemscope => true, :multiple => true, :readonly => true, :allowfullscreen => true, :seamless => true, :typemustmatch => true, :sortable => true, :default => true, :inert => true, :truespeed => true)
Expand Down Expand Up @@ -140,6 +148,16 @@ def test_tag_honors_html_safe_with_escaped_array_class
assert_equal '<p class="song> play&gt;" />', str
end

def test_tag_does_not_honor_html_safe_double_quotes_as_attributes
assert_dom_equal '<p title="&quot;">content</p>',
content_tag('p', "content", title: '"'.html_safe)
end

def test_data_tag_does_not_honor_html_safe_double_quotes_as_attributes
assert_dom_equal '<p data-title="&quot;">content</p>',
content_tag('p', "content", data: { title: '"'.html_safe })
end

def test_skip_invalid_escaped_attributes
['&1;', '&#1dfa3;', '& #123;'].each do |escaped|
assert_equal %(<a href="#{escaped.gsub(/&/, '&amp;')}" />), tag('a', :href => escaped)
Expand Down
5 changes: 5 additions & 0 deletions activejob/CHANGELOG.md
@@ -1,3 +1,8 @@
## Rails 4.2.7 (July 12, 2016) ##

* No changes.


## Rails 4.2.6 (March 07, 2016) ##

* No changes.
Expand Down
4 changes: 2 additions & 2 deletions activejob/lib/active_job/gem_version.rb
Expand Up @@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 6
PRE = nil
TINY = 7
PRE = "1"

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
Expand Down
2 changes: 1 addition & 1 deletion activejob/lib/active_job/logging.rb
Expand Up @@ -40,7 +40,7 @@ module Logging #:nodoc:
def tag_logger(*tags)
if logger.respond_to?(:tagged)
tags.unshift "ActiveJob" unless logger_tagged_by_active_job?
ActiveJob::Base.logger.tagged(*tags){ yield }
logger.tagged(*tags){ yield }
else
yield
end
Expand Down
7 changes: 6 additions & 1 deletion activejob/test/cases/logging_test.rb
Expand Up @@ -3,6 +3,7 @@
require 'active_support/core_ext/numeric/time'
require 'jobs/hello_job'
require 'jobs/logging_job'
require 'jobs/overridden_logging_job'
require 'jobs/nested_job'
require 'models/person'

Expand Down Expand Up @@ -41,7 +42,6 @@ def set_logger(logger)
ActiveJob::Base.logger = logger
end


def test_uses_active_job_as_tag
HelloJob.perform_later "Cristian"
assert_match(/\[ActiveJob\]/, @logger.messages)
Expand Down Expand Up @@ -111,4 +111,9 @@ def test_enqueue_in_job_logging
rescue NotImplementedError
skip
end

def test_for_tagged_logger_support_is_consistent
set_logger ::Logger.new(nil)
OverriddenLoggingJob.perform_later "Dummy"
end
end
9 changes: 9 additions & 0 deletions activejob/test/jobs/overridden_logging_job.rb
@@ -0,0 +1,9 @@
class OverriddenLoggingJob < ActiveJob::Base
def perform(dummy)
logger.info "Dummy, here is it: #{dummy}"
end

def logger
@logger ||= ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(nil))
end
end
5 changes: 5 additions & 0 deletions activemodel/CHANGELOG.md
@@ -1,3 +1,8 @@
## Rails 4.2.7 (July 12, 2016) ##

* No changes.


## Rails 4.2.6 (March 07, 2016) ##

* No changes.
Expand Down
4 changes: 2 additions & 2 deletions activemodel/lib/active_model/gem_version.rb
Expand Up @@ -7,8 +7,8 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 6
PRE = nil
TINY = 7
PRE = "1"

STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
end
Expand Down
27 changes: 27 additions & 0 deletions activerecord/CHANGELOG.md
@@ -1,3 +1,30 @@
* Allow `joins` to be unscoped.

Fixes #13775.

*Takashi Kokubun*

* Hashes can once again be passed to setters of `composed_of`, if all of the
mapping methods are methods implemented on `Hash`.

Fixes #25978.

*Sean Griffin*


## Rails 4.2.7 (July 12, 2016) ##

* Inspecting an object with an associated array of over 10 elements no longer
truncates the array, preventing `inspect` from looping infinitely in some
cases.

*Kevin McPhillips*

* Ensure hashes can be assigned to attributes created using `composed_of`.
Fixes #25210.

*Sean Griffin*

* Queries such as `Computer.joins(:monitor).group(:status).count` will now be
interpreted as `Computer.joins(:monitor).group('computers.status').count`
so that when `Computer` and `Monitor` have both `status` columns we don't
Expand Down

0 comments on commit 8e7f6a6

Please sign in to comment.