Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
...
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Xavier Noria
9617db2078
applies new string literal convention in activerecord/test
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 18:26:53 +02:00
Benjamin Quorning
763de2ac1c
Optimize ActiveRecord::Result#last
...
If you only want the last element of a result set, there's no need to create all
of hash_rows. Also, add a test.
2016-06-24 11:43:48 +02:00
Benjamin Quorning
e292ce8a4f
Add ActiveRecord::Result#first
...
When you only need the first element of a result set, you shouldn't need to
instantiate all of hash_rows.
2016-06-24 11:43:22 +02:00
Aaron Patterson
f0c2c6469f
add length to ActiveRecord::Result
2014-10-13 12:01:41 -07:00
Sean Griffin
c083ce6dd2
Encapsulate knowledge of type objects on ActiveRecord::Result
...
Attempting to reduce the number of places that care about the details of
how type casting occurs. We remove the type casting of the primary key
in `JoinDependecy`, rather than encapsulating it. It was originally
added for consistency with
40898c8c19 (diff-06059df8d3dee3101718fb2c01151ad0R211)
,
but that conditional was later removed in
d7ddaa530f
.
What is important is that the same row twice will have the same value
for the primary key, which it will.
2014-06-22 09:00:15 -06:00
Marc-Andre Lafortune
13d2696c10
Return sized enumerator from Batches#find_each
2014-02-05 16:53:02 -05:00
Marc-Andre Lafortune
4499ab5fde
Strengthen test with different nb of rows and columns
2014-02-05 16:45:56 -05:00
Carlos Antonio da Silva
755069ee4e
Merge pull request #10993 from Empact/result-each-enumerator
...
Change Result#each to return an Enumerator when called without a block.
2013-06-25 20:07:59 -03:00
Ben Woosley
d6cfbaea72
Change Result#each to return an Enumerator when called without a block.
...
As with #10992 , this lets us call #with_index, etc on the results.
2013-06-18 15:34:18 -07:00