New upstream version 4.2.10

parent 32d10df8
......@@ -14,54 +14,54 @@ GIT
PATH
remote: .
specs:
actionmailer (4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
actionmailer (4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.9)
actionview (= 4.2.9)
activesupport (= 4.2.9)
actionpack (4.2.10)
actionview (= 4.2.10)
activesupport (= 4.2.10)
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.9)
activesupport (= 4.2.9)
actionview (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.9)
activesupport (= 4.2.9)
activejob (4.2.10)
activesupport (= 4.2.10)
globalid (>= 0.3.0)
activemodel (4.2.9)
activesupport (= 4.2.9)
activemodel (4.2.10)
activesupport (= 4.2.10)
builder (~> 3.1)
activerecord (4.2.9)
activemodel (= 4.2.9)
activesupport (= 4.2.9)
activerecord (4.2.10)
activemodel (= 4.2.10)
activesupport (= 4.2.10)
arel (~> 6.0)
activesupport (4.2.9)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
rails (4.2.9)
actionmailer (= 4.2.9)
actionpack (= 4.2.9)
actionview (= 4.2.9)
activejob (= 4.2.9)
activemodel (= 4.2.9)
activerecord (= 4.2.9)
activesupport (= 4.2.9)
rails (4.2.10)
actionmailer (= 4.2.10)
actionpack (= 4.2.10)
actionview (= 4.2.10)
activejob (= 4.2.10)
activemodel (= 4.2.10)
activerecord (= 4.2.10)
activesupport (= 4.2.10)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.9)
railties (= 4.2.10)
sprockets-rails
railties (4.2.9)
actionpack (= 4.2.9)
activesupport (= 4.2.9)
railties (4.2.10)
actionpack (= 4.2.10)
activesupport (= 4.2.10)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
## Rails 4.2.10 (September 27, 2017) ##
* Fix regression in behavior of `normalize_path`.
In Rails 5 there was a change to ensure the encoding of the original string
in a path was maintained. This was incorrectly backported to Rails 4.2 which
caused a regression.
*Eileen M. Uchitelle*
## Rails 4.2.9 (June 26, 2017) ##
* Use more specific check for :format in route path
......
......@@ -13,13 +13,11 @@ class Utils # :nodoc:
# normalize_path("") # => "/"
# normalize_path("/%ab") # => "/%AB"
def self.normalize_path(path)
encoding = path.encoding
path = "/#{path}"
path = "/#{path}".force_encoding(Encoding::UTF_8)
path.squeeze!('/')
path.sub!(%r{/+\Z}, '')
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
path = "/" if path == "".freeze
path.force_encoding(encoding)
path = '/' if path == ''
path
end
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
......@@ -4196,51 +4196,26 @@ def show
end
end
if RUBY_VERSION < '2.0.0'
test "invalid UTF-8 encoding returns a 400 Bad Request" do
with_routing do |set|
set.draw do
get "/bar/:id", :to => redirect("/foo/show/%{id}")
get "/foo/show(/:id)", :to => "test_invalid_urls/foo#show"
get "/foo(/:action(/:id))", :controller => "test_invalid_urls/foo"
get "/:controller(/:action(/:id))"
end
get "/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/foo/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/foo/show/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/bar/%E2%EF%BF%BD%A6"
assert_response :bad_request
test "invalid UTF-8 encoding is treated as ASCII 8BIT encode" do
with_routing do |set|
set.draw do
get "/bar/:id", :to => redirect("/foo/show/%{id}")
get "/foo/show(/:id)", :to => "test_invalid_urls/foo#show"
get "/foo(/:action(/:id))", :controller => "test_invalid_urls/foo"
get "/:controller(/:action(/:id))"
end
end
else
test "invalid UTF-8 encoding is treated as ASCII 8BIT encode" do
with_routing do |set|
set.draw do
get "/bar/:id", :to => redirect("/foo/show/%{id}")
get "/foo/show(/:id)", :to => "test_invalid_urls/foo#show"
get "/foo(/:action(/:id))", :controller => "test_invalid_urls/foo"
get "/:controller(/:action(/:id))"
end
get "/%E2%EF%BF%BD%A6"
assert_response :not_found
get "/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/foo/%E2%EF%BF%BD%A6"
assert_response :not_found
get "/foo/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/foo/show/%E2%EF%BF%BD%A6"
assert_response :ok
get "/foo/show/%E2%EF%BF%BD%A6"
assert_response :bad_request
get "/bar/%E2%EF%BF%BD%A6"
assert_response :redirect
end
get "/bar/%E2%EF%BF%BD%A6"
assert_response :bad_request
end
end
end
......
......@@ -32,12 +32,6 @@ def test_normalize_path_not_greedy
def test_normalize_path_uppercase
assert_equal "/foo%AAbar%AAbaz", Utils.normalize_path("/foo%aabar%aabaz")
end
def test_normalize_path_maintains_string_encoding
skip "#b is not defined" if RUBY_VERSION < '2.0.0'
path = "/foo%AAbar%AAbaz".b
assert_equal Encoding::ASCII_8BIT, Utils.normalize_path(path).encoding
end
end
end
end
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
## Rails 4.2.10 (September 27, 2017) ##
* `Relation#joins` is no longer affected by the target model's
`current_scope`, with the exception of `unscoped`.
Fixes #29338.
*Sean Griffin*
## Rails 4.2.9 (June 26, 2017) ##
* Fix regression caused by `collection_singular_ids=` ignoring different primary key on relationship.
......
......@@ -53,10 +53,8 @@ def join_constraints(foreign_table, foreign_klass, node, join_type, tables, scop
scope_chain_index += 1
klass_scope =
if klass.current_scope
klass.current_scope.clone.tap { |scope|
scope.joins_values = []
}
if klass.current_scope && klass.current_scope.values.blank?
klass.unscoped
else
klass.send(:build_default_scope, ActiveRecord::Relation.create(klass, table))
end
......
......@@ -282,6 +282,14 @@ def unquoted_false
0
end
def quoted_date(value)
if supports_datetime_with_precision? && value.acts_like?(:time) && value.respond_to?(:usec)
"#{super}.#{sprintf("%06d", value.usec)}"
else
super
end
end
# REFERENTIAL INTEGRITY ====================================
def disable_referential_integrity #:nodoc:
......
......@@ -74,14 +74,6 @@ def quote_string(string)
@connection.escape(string)
end
def quoted_date(value)
if supports_datetime_with_precision? && value.acts_like?(:time) && value.respond_to?(:usec)
"#{super}.#{sprintf("%06d", value.usec)}"
else
super
end
end
#--
# CONNECTION MANAGEMENT ====================================
#++
......
......@@ -282,6 +282,10 @@ def cast_value(value)
super
end
end
def has_precision?
precision || 0
end
end
class Time < Type::Time # :nodoc:
......@@ -328,8 +332,11 @@ def find_type(field)
def initialize_type_map(m) # :nodoc:
super
m.register_type %r(datetime)i, Fields::DateTime.new
m.register_type %r(time)i, Fields::Time.new
m.register_type(%r(datetime)i) do |sql_type|
precision = extract_precision(sql_type)
Fields::DateTime.new(precision: precision)
end
end
def exec_without_stmt(sql, name = 'SQL') # :nodoc:
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
......@@ -74,7 +74,7 @@ def mysql_datetime_precision(table_name, column_name)
result = results.find do |result_hash|
result_hash["column_name"] == column_name
end
result && result["datetime_precision"]
result && result["datetime_precision"].to_i
end
def activerecord_column_option(tablename, column_name, option)
......
......@@ -46,9 +46,8 @@ def in_memory_db?
end
def mysql_56?
current_adapter?(:MysqlAdapter, :Mysql2Adapter) &&
ActiveRecord::Base.connection.send(:version) >= '5.6.0' &&
ActiveRecord::Base.connection.send(:version) < '5.7.0'
current_adapter?(:Mysql2Adapter) &&
ActiveRecord::Base.connection.send(:version) >= '5.6.0'
end
def mysql_enforcing_gtid_consistency?
......
......@@ -382,6 +382,16 @@ def test_default_scope_with_joins
Comment.joins(:post).count
end
def test_joins_not_affected_by_scope_other_than_default_or_unscoped
without_scope_on_post = Comment.joins(:post).to_a
with_scope_on_post = nil
Post.where(id: [1, 5, 6]).scoping do
with_scope_on_post = Comment.joins(:post).to_a
end
assert_equal with_scope_on_post, without_scope_on_post
end
def test_unscoped_with_joins_should_not_have_default_scope
assert_equal SpecialPostWithDefaultScope.unscoped { Comment.joins(:special_post_with_default_scope).to_a },
Comment.joins(:post).to_a
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* Fixed bug in `DateAndTime::Compatibility#to_time` that caused it to
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
......@@ -3,6 +3,10 @@
include FileUtils
commands = [
'mysql -e "create user rails@localhost;"',
'mysql -e "grant all privileges on activerecord_unittest.* to rails@localhost;"',
'mysql -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"',
'mysql -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"',
'mysql -e "create database activerecord_unittest;"',
'mysql -e "create database activerecord_unittest2;"',
'psql -c "create database activerecord_unittest;" -U postgres',
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -950,7 +950,7 @@ In order to test that your mailer is working as expected, you can use unit tests
For the purposes of unit testing a mailer, fixtures are used to provide an example of how the output _should_ look. Because these are example emails, and not Active Record data like the other fixtures, they are kept in their own subdirectory apart from the other fixtures. The name of the directory within `test/fixtures` directly corresponds to the name of the mailer. So, for a mailer named `UserMailer`, the fixtures should reside in `test/fixtures/user_mailer` directory.
When you generated your mailer, the generator creates stub fixtures for each of the mailers actions. If you didn't use the generator you'll have to make those files yourself.
If you generated your mailer, the generator does not create stub fixtures for the mailers actions. You'll have to create those files yourself as described above.
#### The Basic Test Case
......
## Rails 4.2.10 (September 27, 2017) ##
* No changes.
## Rails 4.2.9 (June 26, 2017) ##
* No changes.
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
......@@ -7,7 +7,7 @@ def self.gem_version
module VERSION
MAJOR = 4
MINOR = 2
TINY = 9
TINY = 10
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment