Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | resolve aliases before passing the hash to the predicate builder | Aaron Patterson | 2013-07-02 | 1 | -4/+10 |
| | |||||
* | we don't need to to_s the column | Aaron Patterson | 2013-07-01 | 1 | -1/+1 |
| | |||||
* | the data structure used to store attribute aliases should not be exposed | Aaron Patterson | 2013-07-01 | 1 | -2/+2 |
| | |||||
* | Handle aliased attributes in ActiveRecord::Relation. | Godfrey Chan | 2013-05-01 | 1 | -0/+4 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database: With the model class Topic alias_attribute :heading, :title end The call Topic.where(heading: 'The First Topic') should yield the same result as Topic.where(title: 'The First Topic') This also applies to ActiveRecord::Relation::Calculations calls such as `Model.sum(:aliased)` and `Model.pluck(:aliased)`. This will not work with SQL fragment strings like `Model.sum('DISTINCT aliased')`. Github #7839 *Godfrey Chan* | ||||
* | stop calling to_sym when building arel nodes [CVE-2013-1854] | Aaron Patterson | 2013-03-15 | 1 | -1/+1 |
| | |||||
* | Revert "Merge pull request #9207 from dylanahsmith/mysql-quote-numeric" | Steve Klabnik | 2013-02-27 | 1 | -5/+0 |
| | | | | | This reverts commit 408227d9c5ed7de26310d72a1a99c1ee02311c63, reversing changes made to dca0b57d03deffc933763482e615c3cf0b9a1d97. | ||||
* | Use IN operator like arel for empty hash in where clause | robertomiranda | 2013-02-09 | 1 | -1/+1 |
| | |||||
* | Reverting e170014113 (Change behaviour with empty hash in where clause) | Guillermo Iguaran | 2013-02-08 | 1 | -1/+1 |
| | |||||
* | Reverting 16f6f25 (Change behaviour with empty array in where clause) | Guillermo Iguaran | 2013-02-08 | 1 | -2/+0 |
| | |||||
* | Change behaviour with empty array in where clause | robertomiranda | 2013-02-08 | 1 | -0/+2 |
| | |||||
* | Change behaviour with empty hash in where clause | robertomiranda | 2013-02-08 | 1 | -1/+1 |
| | |||||
* | active_record: Quote numeric values compared to string columns. | Dylan Smith | 2013-02-07 | 1 | -0/+5 |
| | |||||
* | reduce the number of queries on IN clauses, fix relation queries in `where` | Aaron Patterson | 2013-01-24 | 1 | -1/+1 |
| | |||||
* | stop converting strings to symbols | Aaron Patterson | 2013-01-24 | 1 | -1/+1 |
| | |||||
* | Refactor predicate builder when receiving empty hash | Carlos Antonio da Silva | 2013-01-17 | 1 | -4/+4 |
| | | | | | | | There's no need to create a new arel table or reflect on the column association if the value is empty, these attributes are not used. Also no need to concat a new array, just append the query value. | ||||
* | 1.9 Syntax related changes | AvnerCohen | 2012-11-10 | 1 | -2/+2 |
| | |||||
* | Remove ActiveRecord::Model | Jon Leighton | 2012-10-26 | 1 | -3/+3 |
| | | | | | | | | | | 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. | ||||
* | rename AR::Model::Tag to AR::Tag - fixes #7714 | Francesco Rodriguez | 2012-09-20 | 1 | -1/+1 |
| | |||||
* | fix querying with an empty hash | Damien Mathieu | 2012-09-19 | 1 | -2/+6 |
| | | | | Closes #6960 | ||||
* | Pass in the model class rather than engine | Jon Leighton | 2012-09-13 | 1 | -5/+5 |
| | | | | | | | | | In some circumstances engine was Arel::Table.engine which for separate reasons was an ActiveRecord::Model::DeprecationProxy, which caused a deprecation warning. In any case, we want the actual model class here, since we want to use it to infer information about associations. | ||||
* | Refactor to remove some duplication | Jon Leighton | 2012-09-12 | 1 | -37/+20 |
| | |||||
* | Fix nested association references | Jon Leighton | 2012-09-12 | 1 | -3/+4 |
| | | | | | Previously the reflection would be looked up on the wrong class. However the test passed because the examples referred back to themselves. | ||||
* | Accept belongs_to assoc. keys in ActiveRecord queries | beerlington | 2012-09-11 | 1 | -4/+48 |
| | | | | | | | | | | | | | Allows you to specify the model association key in a belongs_to relationship instead of the foreign key. The following queries are now equivalent: Post.where(:author_id => Author.first) Post.where(:author => Author.first) PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure) PriceEstimate.where(:estimate_of => treasure) | ||||
* | Remove conditional committed by accident | Santiago Pastorino | 2012-06-09 | 1 | -1/+1 |
| | |||||
* | Use each_with_object instead of each here | Santiago Pastorino | 2012-06-09 | 1 | -1/+1 |
| | |||||
* | predicate builder should not recurse for determining where columns. | Aaron Patterson | 2012-05-30 | 1 | -1/+1 |
| | | | | | | Thanks to Ben Murphy for reporting this CVE-2012-2661 | ||||
* | CollectionProxy < Relation | Jon Leighton | 2012-05-11 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | | | | This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association. | ||||
* | Remove Arel::Relation constant from PredicateBuilder. | Juanjo Bazán | 2012-03-27 | 1 | -2/+2 |
| | |||||
* | Refactor and cleanup in some ActiveRecord modules | Carlos Antonio da Silva | 2012-03-03 | 1 | -14/+13 |
| | | | | | | | | | | | * Avoid double hash lookups in AR::Reflection when reflecting associations/aggregations * Minor cleanups: use elsif, do..end, if..else instead of unless..else * Simplify DynamicMatchers#respond_to? * Use "where" instead of scoped with conditions hash * Extract `scoped_by` method pattern regexp to constant * Extract noisy class_eval from method_missing in dynamic matchers * Extract readonly check, avoid calling column#to_s twice in persistence * Refactor predicate builder, remove some variables | ||||
* | automatically add references when we can | Jon Leighton | 2012-01-16 | 1 | -0/+12 |
| | |||||
* | refactor AR::PredicateBuilder.build_from_hash | Akira Matsuda | 2011-12-29 | 1 | -35/+37 |
| | |||||
* | where(foo: [1, nil]) becomes "WHERE foo = 1 OR foo IS NULL" | Akira Matsuda | 2011-12-28 | 1 | -1/+4 |
| | | | | was "WHERE foo IN (1) OR foo IS NULL" before | ||||
* | no need to compact an already compacted Array | Akira Matsuda | 2011-12-28 | 1 | -1/+1 |
| | |||||
* | Make PredicateBuilder recognise AR::Model | Jon Leighton | 2011-12-24 | 1 | -2/+2 |
| | |||||
* | pushing caching and visitors down to the connection | Aaron Patterson | 2011-11-19 | 1 | -1/+1 |
| | |||||
* | Fixes issue #3483, regarding using a mixture of ranges and discrete values ↵ | Ryan Naughton | 2011-11-14 | 1 | -6/+8 |
| | | | | in find conditions. Paired with Joey Schoblaska. | ||||
* | Fix PredicateBuilder clobbering select_values in subquery. | Ernie Miller | 2011-08-20 | 1 | -1/+1 |
| | |||||
* | Fix assumption of primary key name in PredicateBuilder subquery. | Ernie Miller | 2011-08-20 | 1 | -1/+1 |
| | |||||
* | supporting nil when passed in as an IN clause | Aaron Patterson | 2011-04-29 | 1 | -1/+12 |
| | |||||
* | use Arel::Table#alias rather than passing the :as parameter | Aaron Patterson | 2011-03-05 | 1 | -2/+2 |
| | |||||
* | Split AssociationProxy into an Association class (and subclasses) which ↵ | Jon Leighton | 2011-02-18 | 1 | -1/+1 |
| | | | | manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more. | ||||
* | use the arel table rather than generating strings | Aaron Patterson | 2011-02-16 | 1 | -1/+1 |
| | |||||
* | no need for Array.wrap | Aaron Patterson | 2011-02-16 | 1 | -1/+1 |
| | |||||
* | removed an unnecessary second query when passing an ActiveRecord::Relation ↵ | Steven Fenigstein | 2011-02-16 | 1 | -1/+4 |
| | | | | to a where clause. And added ability to use subselects in where clauses. | ||||
* | User id instead of quoted_id to prevent double quoting. Fixes failing test ↵ | Robert Pankowecki (Gavdi) | 2011-01-04 | 1 | -1/+1 |
| | | | | for bug #6036. | ||||
* | arel can escape the id, so avoid using the database connection | Aaron Patterson | 2010-12-22 | 1 | -1/+1 |
| | |||||
* | Arel::Table#[] always returns an attribute, so no need for || | Aaron Patterson | 2010-12-22 | 1 | -1/+1 |
| | |||||
* | to_sym stuff before passing it to arel | Aaron Patterson | 2010-12-22 | 1 | -1/+1 |
| | |||||
* | just wrap as a sql literal | Aaron Patterson | 2010-11-23 | 1 | -2/+1 |
| | |||||
* | Do not send id for quoting twice if the primary key is string. | Neeraj Singh | 2010-11-23 | 1 | -1/+2 |
| | | | | [#6022 state:resolved] |