aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/result.rb
Commit message (Collapse)AuthorAgeFilesLines
* Encapsulate knowledge of type objects on `ActiveRecord::Result`Sean Griffin2014-06-221-8/+15
| | | | | | | | | | | | | 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 https://github.com/rails/rails/commit/40898c8c19fa04442fc5f8fb5daf3a8bdb9a1e03#diff-06059df8d3dee3101718fb2c01151ad0R211, but that conditional was later removed in https://github.com/rails/rails/commit/d7ddaa530fd1b94e22d745cbaf2e8a5a34ee9734. What is important is that the same row twice will have the same value for the primary key, which it will.
* Introduce an Attribute object to handle the type casting danceSean Griffin2014-06-131-1/+1
| | | | | | | | | | | | | | | There's a lot more that can be moved to these, but this felt like a good place to introduce the object. Plans are: - Remove all knowledge of type casting from the columns, beyond a reference to the cast_type - Move type_cast_for_database to these objects - Potentially make them mutable, introduce a state machine, and have dirty checking handled here as well - Move `attribute`, `decorate_attribute`, and anything else that modifies types to mess with this object, not the columns hash - Introduce a collection object to manage these, reduce allocations, and not require serializing the types
* Use an actual identity type in AR::Result#identity_typeSean Griffin2014-06-091-1/+1
| | | | | We should be able to rely on this object implenting the full type interface.
* Rename attribute related instance variables to better express intentSean Griffin2014-05-301-1/+1
| | | | | | | | | `@attributes` was actually used for `_before_type_cast` and friends, while `@attributes_cache` is the type cast version (and caching is the wrong word there, but I'm working on removing the conditionals around that). I opted for `@raw_attributes`, because `_before_type_cast` is also semantically misleading. The values in said hash are in the state given by the form builder or database, so raw seemed to be a good word.
* Return sized enumerator from Batches#find_eachMarc-Andre Lafortune2014-02-051-1/+1
|
* Also dup `column_types` in AR::Result `initialize_copy`Vipul A M2013-11-101-3/+4
|
* typecast records returned from the db rather than to_sing everythingAaron Patterson2013-10-081-0/+4
|
* Perf: micro optimised Result column hash_row creationSam2013-08-291-1/+15
|
* Added some usage about ActiveRecord::Result [ci skip]kennyj2013-07-231-2/+26
|
* make the identity type a singleton to save on object creationAaron Patterson2013-07-011-0/+6
|
* Change Result#each to return an Enumerator when called without a block.Ben Woosley2013-06-181-1/+5
| | | | As with #10992, this lets us call #with_index, etc on the results.
* Remove ActiveRecord::ModelJon Leighton2012-10-261-1/+1
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Freeze columns only once per ResultSantiago Pastorino2012-09-201-6/+9
|
* Freeze columns just before using them as hash keysSantiago Pastorino2012-09-201-2/+5
|
* Freeze columns before using them as hash keysJeremy Evans2012-09-131-1/+1
| | | This reduces the number of allocated strings from columns * (rows + 1) to just columns.
* Refactor AR::Result or inherits. Because we have redundant codes aboutkennyj2012-08-221-2/+2
|
* Doc for ActiveRecord::Result empty? methodRob Zolkos2012-05-071-0/+1
|
* moving column types to an ivar on the resultAaron Patterson2012-02-071-8/+5
|
* column types are passed from the result set to the instantiated AR objectAaron Patterson2012-02-071-0/+4
|
* QueryCache will just dup an AR::Result, AR::Result can deep copyAaron Patterson2012-01-311-0/+6
|
* made the result set object act more like an arrayAaron Patterson2012-01-311-0/+19
|
* Remove extra white spaces on ActiveRecord docs.Sebastian Martinez2011-05-231-1/+1
|
* updating the docco for ActiveRecord::ResultAaron Patterson2011-04-111-2/+2
|
* adjust query counts to be consistent across databases, make sure database ↵Aaron Patterson2011-02-041-0/+4
| | | | log the same things
* AR internals expect a normal hash, otherwise there are serialization ↵Aaron Patterson2011-01-051-1/+1
| | | | incompatibilities
* exec returns an AR::ResultAaron Patterson2010-10-261-0/+30