aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/result.rb
Commit message (Collapse)AuthorAgeFilesLines
* Improve docs for ActiveRecord::Result. [ci skip]Trevor Reiff2017-02-241-1/+12
| | | | Remove styling from `true` and `false`.
* Add `Type.default_value` and use it everywhere for internalRyuta Kamizono2016-08-261-3/+1
| | | | For reduce instantiating `Type::Value`.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-29/+29
|
* Optimize ActiveRecord::Result#lastBenjamin Quorning2016-06-241-1/+2
| | | | | 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.
* Add ActiveRecord::Result#firstBenjamin Quorning2016-06-241-0/+5
| | | | | When you only need the first element of a result set, you shouldn't need to instantiate all of hash_rows.
* applies new doc guidelines to Active Record.Yves Senn2015-10-141-2/+3
| | | | | | | | | | | | | | | | | | | The focus of this change is to make the API more accessible. References to method and classes should be linked to make it easy to navigate around. This patch makes exzessiv use of `rdoc-ref:` to provide more readable docs. This makes it possible to document `ActiveRecord::Base#save` even though the method is within a separate module `ActiveRecord::Persistence`. The goal here is to bring the API closer to the actual code that you would write. This commit only deals with Active Record. The other gems will be updated accordingly but in different commits. The pass through Active Record is not completely finished yet. A follow up commit will change the spots I haven't yet had the time to update. /cc @fxn
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-1/+1
|
* Revert "Improve performance of AR object instantiation"Sean Griffin2014-11-141-9/+0
| | | | | | | | | | This reverts commit 8fee923888192a658d8823b31e77ed0683dfd665. Conflicts: activerecord/lib/active_record/attribute_set/builder.rb This solution sucks, and is hard to actually apply across the board. Going to try other solutions
* Improve performance of AR object instantiationSean Griffin2014-11-051-0/+9
| | | | | | | We introduced a performance hit by adding an additional iteration through a model's attributes on creation. We don't actually need the values from `Result` to be a hash, we can separate the columns and values and zip them up ourself during the iteration that we have to do.
* add length to ActiveRecord::ResultAaron Patterson2014-10-131-0/+4
|
* 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