activerecord 5.1.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b681beb18e3fb91541c6c1111e35b2a339cc0938
4
- data.tar.gz: 0314f6221b13f28cf656b1d3443588f4d67e7982
3
+ metadata.gz: 394e7cfd6bb07ff7a39f17ac4746817abf40d198
4
+ data.tar.gz: 3574ab9e38c9e64fed64345d15e75eef9d76d213
5
5
  SHA512:
6
- metadata.gz: 57725b96fdd14163059603613367d25276c1392c9389c1a1e79ea1993d569884da3a057869480545ab3310d01cb47e9da06116f42b8ea61c71b5e0dff2fb7bfc
7
- data.tar.gz: e51aae2c1dace0810c3b7f572ba405a8892d07dccce8d4632540c488f875a815ab56e82c8e7de04a9bfe341c7733e4a2cc61187c2297ffefcb2a0fa000fc0f3f
6
+ metadata.gz: 1420d3477fdea2c92a8a5c9dd821b9a8ea95b434c4801c3eb51136f226c2ce61f025f9cf4fa27bc53ddd5d9020f6ecc10caa6dc265fa0da3ee0e9c7efb6b061e
7
+ data.tar.gz: 742c1f4c15c1e18c7ecd57410825f4338931cdd50f44143157c75bd4a5625a41118e3f057adf464e5925711ff231daa993e341fae50c88a451fcf85467619e39
@@ -1,3 +1,10 @@
1
+ * Add type caster to `RuntimeReflection#alias_name`
2
+
3
+ Fixes #28959.
4
+
5
+ *Jon Moss*
6
+
7
+
1
8
  ## Rails 5.1.0 (April 27, 2017) ##
2
9
 
3
10
  * Quote database name in db:create grant statement (when database_user does not have access to create the database).
@@ -10,8 +10,15 @@ module ActiveRecord
10
10
  value = id_value_for_database(value) if value.is_a?(Base)
11
11
 
12
12
  if value.respond_to?(:quoted_id)
13
+ at = value.method(:quoted_id).source_location
14
+ at &&= " at %s:%d" % at
15
+
16
+ owner = value.method(:quoted_id).owner.to_s
17
+ klass = value.class.to_s
18
+ klass += "(#{owner})" unless owner == klass
19
+
13
20
  ActiveSupport::Deprecation.warn \
14
- "Using #quoted_id is deprecated and will be removed in Rails 5.2."
21
+ "Defining #quoted_id is deprecated and will be ignored in Rails 5.2. (defined on #{klass}#{at})"
15
22
  return value.quoted_id
16
23
  end
17
24
 
@@ -7,7 +7,7 @@ module ActiveRecord
7
7
  module VERSION
8
8
  MAJOR = 5
9
9
  MINOR = 1
10
- TINY = 0
10
+ TINY = 1
11
11
  PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -1105,7 +1105,7 @@ module ActiveRecord
1105
1105
  end
1106
1106
 
1107
1107
  def alias_name
1108
- Arel::Table.new(table_name)
1108
+ Arel::Table.new(table_name, type_caster: klass.type_caster)
1109
1109
  end
1110
1110
 
1111
1111
  def all_includes; yield; end
@@ -269,8 +269,7 @@ module ActiveRecord
269
269
  # Returns true if there are no records.
270
270
  def empty?
271
271
  return @records.empty? if loaded?
272
-
273
- limit_value == 0 || !exists?
272
+ !exists?
274
273
  end
275
274
 
276
275
  # Returns true if there are no records.
@@ -307,9 +307,11 @@ module ActiveRecord
307
307
  MSG
308
308
  end
309
309
 
310
- return false if !conditions
310
+ return false if !conditions || limit_value == 0
311
+
312
+ relation = self unless eager_loading?
313
+ relation ||= apply_join_dependency(self, construct_join_dependency(eager_loading: false))
311
314
 
312
- relation = apply_join_dependency(self, construct_join_dependency(eager_loading: false))
313
315
  return false if ActiveRecord::NullRelation === relation
314
316
 
315
317
  relation = construct_relation_for_exists(relation, conditions)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: 5.1.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: 5.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activemodel
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 5.1.0
33
+ version: 5.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 5.1.0
40
+ version: 5.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: arel
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -338,8 +338,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
338
338
  version: '0'
339
339
  requirements: []
340
340
  rubyforge_project:
341
- rubygems_version: 2.6.11
341
+ rubygems_version: 2.6.10
342
342
  signing_key:
343
343
  specification_version: 4
344
344
  summary: Object-relational mapper framework (part of Rails).
345
345
  test_files: []
346
+ has_rdoc: