Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | nodoc the first_or_create methods and document alternatives | Jon Leighton | 2012-10-19 | 1 | -0/+10 |
| | |||||
* | Add Relation#find_or_create_by and friends | Jon Leighton | 2012-10-19 | 1 | -0/+23 |
| | | | | | | | This is similar to #first_or_create, but slightly different and a nicer API. See the CHANGELOG/docs in the commit. Fixes #7853 | ||||
* | learn ActiveRecord::QueryMethods#order work with hash arguments | Tima Maslyuchenko | 2012-10-12 | 1 | -0/+16 |
| | |||||
* | remove duplicated require statements in AR test cases | Yves Senn | 2012-10-09 | 1 | -1/+0 |
| | |||||
* | Model.select takes a variable list of arguments. | Isaac Sanders | 2012-08-23 | 1 | -0/+8 |
| | | | | | | This is a cleaner version of #6916. Closes #3165. | ||||
* | Fix "last equality wins" logic in relation merge | Ernie Miller | 2012-08-19 | 1 | -4/+7 |
| | | | | | | This is a real fix (as compared to the band-aid in b127d86c), which uses the recently-added equality methods for ARel nodes. It has the side benefit of simplifying the merge code a bit. | ||||
* | Fix merge error when Equality LHS is non-attribute | Ernie Miller | 2012-08-17 | 1 | -0/+16 |
| | | | | | | | | | This is at best a band-aid for a more proper fix, since it won't truly handle the removal of the previous equality condition of these other nodes. I'm planning to put in some work on ARel toward supporting that goal. Related: rails/arel#130, ernie/squeel#153, ernie/squeel#156 | ||||
* | Merge pull request #7133 from roshats/fix_update_all_with_blank_argument | Carlos Antonio da Silva | 2012-08-15 | 1 | -0/+4 |
|\ | | | | | | | Change Relation#update_all with blank argument to raise an ArgumentError instead of trying an update with empty fields. | ||||
| * | raise ArgumentError if list of attributes to change is empty in update_all | Roman Shatsov | 2012-08-14 | 1 | -0/+4 |
| | | |||||
* | | Remove ActiveRecord::Base.to_a | Jon Leighton | 2012-08-03 | 1 | -1/+1 |
| | | | | | | | | | | On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway. | ||||
* | | Add `Relation#load` | Jon Leighton | 2012-08-01 | 1 | -0/+8 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method explicitly loads the records and then returns `self`. Rather than deciding between "do I want an array or a relation?", most people are actually asking themselves "do I want to eager load or lazy load?" Therefore, this method provides a way to explicitly eager-load without having to switch from a `Relation` to an array. Example: @posts = Post.where(published: true).load | ||||
* | | AR::Relation#order: make new order prepend old one | Bogdan Gusiev | 2012-07-31 | 1 | -5/+5 |
| | | | | | | | | | | | | | | User.order("name asc").order("created_at desc") # SELECT * FROM users ORDER BY created_at desc, name asc This also affects order defined in `default_scope` or any kind of associations. | ||||
* | | Deprecate ActiveRecord::Base.scoped. | Jon Leighton | 2012-07-27 | 1 | -58/+58 |
| | | | | | | | | | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. | ||||
* | | ActiveRecord::Base.all returns a Relation. | Jon Leighton | 2012-07-27 | 1 | -24/+24 |
|/ | | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway. | ||||
* | support relations created with a table alias | Jon Leighton | 2012-07-13 | 1 | -0/+10 |
| | |||||
* | Relation#inspect handles doesn't perform a new query on an already-loaded ↵ | Jon Leighton | 2012-07-07 | 1 | -1/+12 |
| | | | | relation | ||||
* | Limit the number of records in Relation#inspect | Damien Mathieu | 2012-07-06 | 1 | -0/+5 |
| | | | | While it's interesting to have the results array, it can make a console or a webpage freeze if there are a lot of them. So this limits the number of records displayed in #inspect to 10 and tells how much were effectively found. | ||||
* | Show the records in Relation#inspect | Jon Leighton | 2012-07-06 | 1 | -0/+5 |
| | | | | | | | | | | | | | | | | | The reason for removing the previous implementation of `#inspect` was that it hid from you that you were dealing with a `Relation` rather than an `Array`. But it is still useful to be able to see the records, particularly if you're writing something like the following in tests: assert_equal [foo], Post.where(:bar) If the assertion fails, you want to see what records were actually loaded. So this implementation makes it clear that you've got a `Relation`, but also shows your records. | ||||
* | disallow mutating a relation once loaded | Jon Leighton | 2012-06-22 | 1 | -0/+27 |
| | |||||
* | a test case that ensures AR::Relation#merge can merge associations | Akira Matsuda | 2012-06-03 | 1 | -0/+8 |
| | |||||
* | modulize AR::NullRelation | Akira Matsuda | 2012-06-01 | 1 | -1/+6 |
| | | | | now we can invoke previously added scope extension methods | ||||
* | fixed typo in word finiding | Ivan Kukobko | 2012-05-20 | 1 | -1/+1 |
| | |||||
* | quarantine more deprecated stuff | Jon Leighton | 2012-05-18 | 1 | -9/+0 |
| | |||||
* | quarantine deprecated tests | Jon Leighton | 2012-05-18 | 1 | -43/+3 |
| | |||||
* | Relation#from to accept other Relation objects | Radoslav Stankov | 2012-05-17 | 1 | -0/+7 |
| | | | | Record.from("(#{sub_query.to_sql})") -> Record.from(sub_query) Record.from("(#{sub_query.to_sql}) a") -> Record.from(sub_query, :a) | ||||
* | Return false for exists? with new records - fixes #6199. | Andrew White | 2012-05-10 | 1 | -0/+1 |
| | |||||
* | Use `take` instead of `first` to avoid unwanted implicit ordering (fixes #6147) | Marcelo Silveira | 2012-05-05 | 1 | -1/+9 |
| | |||||
* | delete_all raise an error if a limit is provided - fixes #4979 | Francesco Rodriguez | 2012-04-30 | 1 | -0/+4 |
| | |||||
* | find and replace deprecated keys | Jon Leighton | 2012-04-27 | 1 | -1/+1 |
| | |||||
* | %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵ | Jon Leighton | 2012-04-27 | 1 | -8/+3 |
| | | | | things | ||||
* | remove deprecate #all usage | Jon Leighton | 2012-04-26 | 1 | -4/+0 |
| | |||||
* | remove deprecated scope stuff | Jon Leighton | 2012-04-26 | 1 | -13/+0 |
| | |||||
* | remove tests for #with_scope (it's now deprecated) | Jon Leighton | 2012-04-25 | 1 | -1/+0 |
| | |||||
* | Override AR::Relation methods in NullRelation. | Juanjo Bazán | 2012-04-11 | 1 | -0/+33 |
| | | | So a NullRelation (Relation#none) is chainable with database methods. | ||||
* | Add Relation#find_by and Relation#find_by! | Jon Leighton | 2012-03-30 | 1 | -0/+34 |
| | |||||
* | Fix typo in ActiveRecord::Relation#blank? test | Ruben Davila | 2012-03-17 | 1 | -1/+1 |
| | |||||
* | Fix ActiveRecord::Relation#blank? tests | Rafael Mendonça França | 2012-03-16 | 1 | -12/+15 |
| | |||||
* | test relation presence fix | Thiago Almeida | 2012-03-16 | 1 | -4/+4 |
| | |||||
* | tests for Relation .present? and .blank? are check cases and shouldn't force ↵ | Thiago Almeida | 2012-03-16 | 1 | -0/+19 |
| | | | | sql-count | ||||
* | Remove IdentityMap | Carlos Antonio da Silva | 2012-03-13 | 1 | -9/+7 |
| | |||||
* | Add dynamic find_or_create_by_{attribute}! method. | Andrew White | 2012-03-12 | 1 | -0/+12 |
| | |||||
* | fix build #5001 reply model required in relations_test | Vishnu Atrai | 2012-02-12 | 1 | -0/+1 |
| | |||||
* | removed unuseful require for reply as we are not using require model | Karunakar (Ruby) | 2012-02-11 | 1 | -1/+0 |
| | |||||
* | Added `none` query method to return zero records. | Juanjo Bazán | 2012-01-31 | 1 | -0/+13 |
| | | | And added NullRelation class implementing the null object pattern for the `Relation` class. | ||||
* | Deprecate inferred JOINs with includes + SQL snippets. | Jon Leighton | 2012-01-16 | 1 | -3/+5 |
| | | | | | | See the CHANGELOG for details. Fixes #950. | ||||
* | infer references from Relation#order | Jon Leighton | 2012-01-16 | 1 | -1/+21 |
| | |||||
* | store references as a string | Jon Leighton | 2012-01-16 | 1 | -4/+4 |
| | |||||
* | automatically add references when we can | Jon Leighton | 2012-01-16 | 1 | -0/+14 |
| | |||||
* | Make referencing an included item trigger eager loading | Jon Leighton | 2012-01-16 | 1 | -0/+11 |
| | |||||
* | Revert "Deprecate implicit eager loading. Closes #950." | Jon Leighton | 2012-01-16 | 1 | -21/+5 |
| | | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9. |