activerecord 4.1.10.rc3 → 4.1.10.rc4

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: 88dc04007dd15249a879ff3762e5739884977eca
4
- data.tar.gz: db36c20f31bb4a4290ef1eefb796a6d2feb7884f
3
+ metadata.gz: 526ac3b31ea3a4d5af87c48e958cd5eae698ee19
4
+ data.tar.gz: 063c77d4a73e9d4215704b54be91218b77b8210e
5
5
  SHA512:
6
- metadata.gz: 4ece8f77bb35cf8829a158c5378d6bc97e75b04028eac75165a0542f43a7796c23dca51633a6d7007b90cb6cad61393ea6a09b6dd6fb16130e16842ed3e87584
7
- data.tar.gz: facf0751e2eb26f07b7826c36cd75c5fa853c85d1f1be7644c93c0bd323c13f3f6c3620ed681da211798b9f53ed4e50e5e119e06b64e849cf1adba244b493058
6
+ metadata.gz: 3d88a239b41bf64a3f940b23149c8f04f5a4741d0bab918e57f82a9ebec3f1ac8cfcf42d601026628f969f8c2bf67d6f6bb926e0a34020a299bea766bfcba031
7
+ data.tar.gz: b03e8172ec595f0933140774f6f9ee7591f986ca60a9f1bd4efc166af48c8e12799711c9cfe75dabceae3546c13ab2e2199224aa012c76f1c0f7185e007caafc
@@ -129,11 +129,11 @@ module ActiveRecord
129
129
  first_nth_or_last(:last, *args)
130
130
  end
131
131
 
132
- def take
132
+ def take(n = nil)
133
133
  if loaded?
134
- target.first
134
+ n ? target.take(n) : target.first
135
135
  else
136
- scope.take.tap do |record|
136
+ scope.take(n).tap do |record|
137
137
  set_inverse_instance record if record.is_a? ActiveRecord::Base
138
138
  end
139
139
  end
@@ -226,8 +226,8 @@ module ActiveRecord
226
226
  @association.last(*args)
227
227
  end
228
228
 
229
- def take
230
- @association.take
229
+ def take(n = nil)
230
+ @association.take(n)
231
231
  end
232
232
 
233
233
  # Returns a new object of the collection type that has been instantiated
@@ -8,7 +8,7 @@ module ActiveRecord
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
10
  TINY = 10
11
- PRE = "rc3"
11
+ PRE = "rc4"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -85,7 +85,7 @@ module ActiveRecord
85
85
  # This is basically emulating an Arel::Nodes::Casted
86
86
  column = record.class.columns_hash[scope_item.to_s]
87
87
  quoted_value = record.class.connection.quote(scope_value, column)
88
- if scope_value
88
+ unless scope_value.nil?
89
89
  node = Arel::Nodes::SqlLiteral.new(quoted_value)
90
90
  end
91
91
 
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: 4.1.10.rc3
4
+ version: 4.1.10.rc4
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: 2015-03-02 00:00:00.000000000 Z
11
+ date: 2015-03-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: 4.1.10.rc3
19
+ version: 4.1.10.rc4
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: 4.1.10.rc3
26
+ version: 4.1.10.rc4
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: 4.1.10.rc3
33
+ version: 4.1.10.rc4
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: 4.1.10.rc3
40
+ version: 4.1.10.rc4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: arel
43
43
  requirement: !ruby/object:Gem::Requirement