Commit c56d62c6 authored by Antonio Terceiro's avatar Antonio Terceiro

Imported Upstream version 4.2.7.1

parent 6c318ccb
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:
......
......@@ -27,6 +27,9 @@ gem 'bcrypt', '~> 3.1.10', require: false
# it being automatically loaded by sprockets
gem 'uglifier', '>= 1.3.0', require: false
# mime-types 3 only support ruby >= 2
gem 'mime-types', '< 3', require: false
group :doc do
gem 'sdoc', '~> 0.4.0'
gem 'redcarpet', '~> 3.1.2', platforms: :ruby
......@@ -72,7 +75,7 @@ group :test do
# gem 'debugger'
# end
platforms :mri do
platforms :mri_21 do
gem 'stackprof'
end
......
......@@ -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)
......@@ -71,19 +71,34 @@ GEM
specs:
amq-protocol (1.9.2)
arel (6.0.3)
backburner (1.2.0)
backburner (1.3.0)
beaneater (~> 1.0)
dante (> 0.1.5)
bcrypt (3.1.10)
bcrypt (3.1.10-x64-mingw32)
bcrypt (3.1.10-x86-mingw32)
bcrypt (3.1.11)
bcrypt (3.1.11-x64-mingw32)
bcrypt (3.1.11-x86-mingw32)
beaneater (1.0.0)
benchmark-ips (2.3.0)
benchmark-ips (2.6.1)
builder (3.2.2)
bunny (1.1.9)
amq-protocol (>= 1.9.2)
celluloid (0.15.2)
timers (~> 1.1.0)
celluloid (0.17.3)
celluloid-essentials
celluloid-extras
celluloid-fsm
celluloid-pool
celluloid-supervision
timers (>= 4.1.1)
celluloid-essentials (0.20.5)
timers (>= 4.1.1)
celluloid-extras (0.20.5)
timers (>= 4.1.1)
celluloid-fsm (0.20.5)
timers (>= 4.1.1)
celluloid-pool (0.20.5)
timers (>= 4.1.1)
celluloid-supervision (0.20.5)
timers (>= 4.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
......@@ -91,22 +106,24 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.0)
concurrent-ruby (1.0.2)
connection_pool (2.2.0)
dalli (2.7.5)
dalli (2.7.6)
dante (0.2.0)
delayed_job (4.1.1)
activesupport (>= 3.0, < 5.0)
delayed_job_active_record (4.1.0)
activerecord (>= 3.0, < 5)
delayed_job (4.1.2)
activesupport (>= 3.0, < 5.1)
delayed_job_active_record (4.1.1)
activerecord (>= 3.0, < 5.1)
delayed_job (>= 3.0, < 5)
erubis (2.7.0)
execjs (2.4.0)
globalid (0.3.6)
activesupport (>= 4.1.0)
hitimes (1.2.4)
hitimes (1.2.4-x86-mingw32)
i18n (0.7.0)
jquery-rails (4.0.5)
rails-dom-testing (~> 1.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
......@@ -115,8 +132,8 @@ GEM
nokogiri
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mail (2.6.4)
mime-types (>= 1.16, < 4)
metaclass (0.0.4)
mime-types (2.99.1)
mini_portile2 (2.0.0)
......@@ -124,24 +141,24 @@ GEM
mocha (0.14.0)
metaclass (~> 0.0.1)
mono_logger (1.1.0)
multi_json (1.11.2)
multi_json (1.12.1)
mustache (0.99.8)
mysql (2.9.1)
mysql2 (0.4.2)
nokogiri (1.6.7.1)
mysql2 (0.4.4)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
nokogiri (1.6.7.1-x64-mingw32)
nokogiri (1.6.7.2-x64-mingw32)
mini_portile2 (~> 2.0.0.rc2)
nokogiri (1.6.7.1-x86-mingw32)
nokogiri (1.6.7.2-x86-mingw32)
mini_portile2 (~> 2.0.0.rc2)
pg (0.18.4)
psych (2.0.17)
que (0.11.2)
que (0.11.5)
queue_classic (3.1.0)
pg (>= 0.17, < 0.19)
racc (1.4.14)
rack (1.6.4)
rack-cache (1.5.1)
rack-cache (1.6.1)
rack (>= 0.4)
rack-protection (1.5.3)
rack
......@@ -155,40 +172,39 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rake (10.4.2)
rdoc (4.2.1)
rake (11.1.2)
rdoc (4.2.2)
json (~> 1.4)
redcarpet (3.1.2)
redis (3.2.2)
redis (3.3.0)
redis-namespace (1.5.2)
redis (~> 3.0, >= 3.0.4)
resque (1.25.2)
resque (1.26.0)
mono_logger (~> 1.0)
multi_json (~> 1.0)
redis-namespace (~> 1.3)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
resque-scheduler (4.0.0)
resque-scheduler (4.2.0)
mono_logger (~> 1.0)
redis (~> 3.0)
resque (~> 1.25)
rufus-scheduler (~> 3.0)
rufus-scheduler (~> 3.2)
ruby-prof (0.11.3)
rufus-scheduler (3.1.10)
rufus-scheduler (3.2.1)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
sequel (4.29.0)
serverengine (1.5.11)
sequel (4.34.0)
serverengine (1.6.3)
sigdump (~> 0.2.2)
sidekiq (4.0.1)
sidekiq (4.1.2)
concurrent-ruby (~> 1.0)
connection_pool (~> 2.2, >= 2.2.0)
json (~> 1.0)
redis (~> 3.2, >= 3.2.1)
sigdump (0.2.3)
sinatra (1.4.6)
rack (~> 1.4)
sigdump (0.2.4)
sinatra (1.4.7)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sneakers (0.1.1.pre)
......@@ -198,26 +214,26 @@ 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)
sqlite3 (1.3.11)
stackprof (0.2.7)
sucker_punch (1.0.5)
celluloid (~> 0.15.2)
stackprof (0.2.9)
sucker_punch (1.6.0)
celluloid (~> 0.17.2)
thor (0.19.1)
thread (0.2.2)
thread_safe (0.3.5)
tilt (2.0.1)
timers (1.1.0)
tilt (2.0.4)
timers (4.1.1)
hitimes
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
vegas (0.1.11)
rack (>= 1.0.0)
w3c_validators (1.2)
......@@ -245,6 +261,7 @@ DEPENDENCIES
jquery-rails (~> 4.0)
json
kindlerb (= 0.1.1)
mime-types (< 3)
minitest (< 5.3.4)
mocha (~> 0.14)
mustache (~> 0.99.8)
......@@ -278,4 +295,4 @@ DEPENDENCIES
w3c_validators
BUNDLED WITH
1.11.2
1.12.5
## Rails 4.2.7 (July 12, 2016) ##
* Removes `-t` from default Sendmail arguments to match the underlying
`Mail::Sendmail` setting.
*Clayton Liggitt*
## Rails 4.2.6 (March 07, 2016) ##
* No changes.
......
......@@ -33,7 +33,7 @@ module DeliveryMethods
add_delivery_method :sendmail, Mail::Sendmail,
location: '/usr/sbin/sendmail',
arguments: '-i -t'
arguments: '-i'
add_delivery_method :test, Mail::TestMailer
end
......
......@@ -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
......
......@@ -61,12 +61,12 @@ def initialize_test_deliveries
set_delivery_method :test
@old_perform_deliveries = ActionMailer::Base.perform_deliveries
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries.clear
end
def restore_test_deliveries
restore_delivery_method
ActionMailer::Base.perform_deliveries = @old_perform_deliveries
ActionMailer::Base.deliveries.clear
end
def set_delivery_method(method)
......@@ -75,6 +75,7 @@ def set_delivery_method(method)
end
def restore_delivery_method
ActionMailer::Base.deliveries.clear
ActionMailer::Base.delivery_method = @old_delivery_method
end
......
......@@ -40,7 +40,7 @@ class DefaultsDeliveryMethodsTest < ActiveSupport::TestCase
test "default sendmail settings" do
settings = {
location: '/usr/sbin/sendmail',
arguments: '-i -t'
arguments: '-i'
}
assert_equal settings, ActionMailer::Base.sendmail_settings
end
......
......@@ -3,6 +3,23 @@
class TestTestMailer < ActionMailer::Base
end
class MailerDeliveriesClearingTest < ActionMailer::TestCase
def before_setup
ActionMailer::Base.deliveries << 'better clear me, setup'
super
end
def after_teardown
super
assert_equal [], ActionMailer::Base.deliveries
end
def test_deliveries_are_cleared_on_setup_and_teardown
assert_equal [], ActionMailer::Base.deliveries
ActionMailer::Base.deliveries << 'better clear me, teardown'
end
end
class CrazyNameMailerTest < ActionMailer::TestCase
tests TestTestMailer
......
## Rails 4.2.7 (July 12, 2016) ##
* No changes.
## Rails 4.2.6 (March 07, 2016) ##
* No changes.
......
......@@ -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
......
......@@ -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
......
## 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
......
......@@ -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
......
......@@ -181,7 +181,7 @@ def tag_option(key, value, escape)
else
value = escape ? ERB::Util.unwrapped_html_escape(value) : value
end
%(#{key}="#{value}")
%(#{key}="#{value.gsub(/"/, '&quot;'.freeze)}")
end
end
end
......
......@@ -140,6 +140,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)
......
## Rails 4.2.7 (July 12, 2016) ##
* No changes.
## Rails 4.2.6 (March 07, 2016) ##
* No changes.
......
......@@ -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
......
......@@ -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
......
......@@ -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'
......@@ -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)
......@@ -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
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
## Rails 4.2.7 (July 12, 2016) ##
* No changes.
## Rails 4.2.6 (March 07, 2016) ##
* No changes.
......
......@@ -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
......
## 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
have conflicts in projection.
*Rafael Sales*
* ActiveRecord::Relation#count: raise an ArgumentError when finder options
are specified or an ActiveRecord::StatementInvalid when an invalid type
is provided for a column name (e.g. a Hash).
Fixes #20434
*Konstantinos Rousis*
* Correctly pass MySQL options when using structure_dump or structure_load
Specifically, it fixes an issue when using SSL authentication.
*Alex Coomans*
## Rails 4.2.6 (March 07, 2016) ##
* Fix a bug where using `t.foreign_key` twice with the same `to_table` within
......
......@@ -244,14 +244,15 @@ def reader_method(name, class_name, mapping, allow_nil, constructor)
def writer_method(name, class_name, mapping, allow_nil, converter)
define_method("#{name}=") do |part|
klass = class_name.constantize
if part.is_a?(Hash)
part = klass.new(*part.values)
end
unless part.is_a?(klass) || converter.nil? || part.nil?
part = converter.respond_to?(:call) ? converter.call(part) : klass.send(converter, part)
end
if part.is_a?(Hash)
part = klass.new(*part.values)
end
if part.nil? && allow_nil
mapping.each { |key, _| self[key] = nil }
@aggregation_cache[name] = nil
......
......@@ -287,9 +287,8 @@ def attributes
# Returns an <tt>#inspect</tt>-like string for the value of the
# attribute +attr_name+. String attributes are truncated up to 50
# characters, Date and Time attributes are returned in the
# <tt>:db</tt> format, Array attributes are truncated up to 10 values.
# Other attributes return the value of <tt>#inspect</tt> without
# modification.
# <tt>:db</tt> format. Other attributes return the value of
# <tt>#inspect</tt> without modification.
#
# person = Person.create!(name: 'David Heinemeier Hansson ' * 3)
#
......@@ -300,7 +299,7 @@ def attributes
# # => "\"2012-10-22 00:15:07\""
#
# person.attribute_for_inspect(:tag_ids)
# # => "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]"
# # => "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]"
def attribute_for_inspect(attr_name)
value = read_attribute(attr_name)
......@@ -308,9 +307,6 @@ def attribute_for_inspect(attr_name)
"#{value[0, 50]}...".inspect
elsif value.is_a?(Date) || value.is_a?(Time)
%("#{value.to_s(:db)}")
elsif value.is_a?(Array) && value.size > 10
inspected = value.first(10).inspect
%(#{inspected[0...-1]}, ...])
else
value.inspect
end
......
......@@ -111,6 +111,18 @@ def initialize(connection, logger = nil, pool = nil) #:nodoc:
@prepared_statements = false
end