Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | minor edit | Vijay Dev | 2011-09-14 | 1 | -1/+1 |
| | |||||
* | Add documentation for the extending method in ActiveRecord:QueryMethods | Ryan Bigg | 2011-09-14 | 1 | -0/+36 |
| | |||||
* | Merge pull request #2485 from akaspick/exists_fix | Jon Leighton | 2011-09-07 | 1 | -1/+3 |
|\ | | | | | fix exists? to return false if passed nil (which may come from a missing | ||||
| * | fix exists? to return false if passed nil (which may come from a missing URL ↵ | Andrew Kaspick | 2011-08-10 | 1 | -1/+3 |
| | | | | | | | | param) | ||||
* | | Use LIMIT sql word in last when it's possible | Damien Mathieu | 2011-09-05 | 1 | -1/+5 |
| | | |||||
* | | use LIMIT SQL word in first - Closes #2783 | Damien Mathieu | 2011-09-05 | 1 | -1/+1 |
| | | |||||
* | | We need to recorder here. Need to drop the order from default scope. | Arun Agrawal | 2011-09-05 | 1 | -1/+1 |
| | | | | | | Fixes #2832 | ||||
* | | Revert "Fixes bug in ActiveRecord::QueryMethods, #1697" | Jon Leighton | 2011-09-04 | 1 | -2/+4 |
| | | | | | | | | | | | | This reverts commit 0df27c98d982ec87d2fb48cfda82694eb267993e. Reverted due to failing test, see #2845. | ||||
* | | Fixes bug in ActiveRecord::QueryMethods, #1697 | Joshua Wehner | 2011-08-31 | 1 | -4/+2 |
| | | | | | | Replace split on comma with a regexp that will reverse all ASC/DESC specifically | ||||
* | | The join_nodes must be passed to the JoinDependency initializer and ↵ | Jon Leighton | 2011-08-29 | 1 | -7/+2 |
| | | | | | | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. | ||||
* | | 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 |
|/ | |||||
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 2 | -5/+5 |
| | | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. | ||||
* | Revert "Merge pull request #2309 from smasry/master" | Jon Leighton | 2011-07-28 | 1 | -1/+1 |
| | | | | | | | This reverts commit 9d396ee8195e31f646e0b89158ed96f4db4ab38f, reversing changes made to fa2bfd832c1d1e997d93c2269a485cc74782c86d. Reason: the change broke the build. | ||||
* | Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697 | Samer Masry | 2011-07-27 | 1 | -1/+1 |
| | |||||
* | Fixed failing query when performing calculation with having based on select. | Dmitriy Kiriyenko | 2011-07-27 | 1 | -0/+1 |
| | |||||
* | Revert "allow select to have multiple arguments" | Piotr Sarnacki | 2011-07-26 | 1 | -6/+3 |
| | | | | | | | This reverts commit 04cc446d178653d362510e79a22db5300d463161. I reverted it because apparently we want to use: select([:a, :b]) instead of select(:a, :b), but there was no tests for that form. | ||||
* | allow select to have multiple arguments | Sławosz Sławiński | 2011-07-26 | 1 | -3/+6 |
| | |||||
* | Ordering with extra spaces was raising a SQL exception | Franck Verrot | 2011-07-24 | 1 | -0/+1 |
| | |||||
* | avoid Symbol#to_proc | Vijay Dev | 2011-07-20 | 1 | -1/+1 |
| | |||||
* | ActiveRecord: Fix eager loading so that giving a blank order clause ↵ | Elliot Winkler | 2011-07-18 | 1 | -1/+1 |
| | | | | generates valid SQL | ||||
* | Merge pull request #1807 from caius/find_in_batches_id_bug | Santiago Pastorino | 2011-07-14 | 1 | -2/+5 |
|\ | | | | | Bugfix by stopping find_in_batches using the records after yielding. | ||||
| * | Stop find_in_batches using the records after yielding. | Caius Durling | 2011-06-21 | 1 | -2/+5 |
| | | | | | | | | | | | | Currently if the code that calls .find_in_batches modifies the yielded array in place then .find_in_batches can enter an infinite loop searching with ruby object ids in the database instead of the primary key of records in the database. This happens because it naively assumes the yielded array hasn't been modified before calling #id on the last object in the array. And ruby (1.8 at least) alias' #id to #object_id so an integer is still returned no matter what the last object is. By moving finding the #id of the last object before yielding the array it means the calling code can do whatever it wants to the array in terms of modifying it in place, and .find_in_batches doesn't care. | ||||
* | | Merge pull request #1823 from gnarg/master | Santiago Pastorino | 2011-07-10 | 1 | -2/+2 |
|\ \ | | | | | | | Log instrumentation name for exists? queries | ||||
| * | | Log instrumentation name for exists? queries | Jon Guymon | 2011-06-22 | 1 | -2/+2 |
| | | | |||||
* | | | fix AR having() not to raise NoMethodError when the given argument does not ↵ | Akira Matsuda | 2011-07-09 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | | | respond to empty? having raises NoMethodError: undefined method `empty?' when a Fixnum or Date/Time were passed via varargs | ||||
* | | | Make `ActiveRecord::Batches#find_each` to not return `self`. | knapo | 2011-07-07 | 1 | -2/+0 |
| | | | | | | | | | | | | This caused that `find_each` was producing extra db call taking all the records from db, and was less efficient than `ActiveRecord::Base#all`. | ||||
* | | | Remove case statement changes from 2e0840d and 56ac32a. Inheritance FTW. | Ernie Miller | 2011-07-06 | 1 | -1/+1 |
| | | | |||||
* | | | Merge pull request #1273 from jeremyf/feature-association-proxy-send | Santiago Pastorino | 2011-07-06 | 1 | -0/+1 |
|\ \ \ | | | | | | | | | Addresses an inconsistency in the ActiveRecord::Base.method_missing handl | ||||
| * | | | Addresses an inconsistency in the ActiveRecord::Base.method_missing handling ↵ | Jeremy Friesen | 2011-05-24 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | of dynamic finder methods and the passing of the &block parameter for :find_by_attributes. | ||||
* | | | | Fixed AR::Relation#sum compatibility with Array#sum | Bogdan Gusiev | 2011-07-05 | 1 | -2/+6 |
| | | | | | | | | | | | | | | | | | | | | In order make Relation behavior closer to Array Made Relation#sum to accept block and delegate it to Array#sum | ||||
* | | | | Fix case | Oriol Gual | 2011-06-28 | 1 | -2/+1 |
| | | | | |||||
* | | | | Update reverse order with new Arel Nodes | Oriol Gual | 2011-06-28 | 1 | -1/+2 |
| | | | | |||||
* | | | | default create_with_value to a hash so we can eliminate conditionals, add ↵ | Aaron Patterson | 2011-06-27 | 2 | -2/+2 |
| | | | | | | | | | | | | | | | | test surrounding create_with(nil) behavior | ||||
* | | | | Apply the default scope earlier when doing calculations. Fixes #1682. | Jon Leighton | 2011-06-23 | 1 | -5/+11 |
| |/ / |/| | | |||||
* | | | Support reversal of ARel orderings in reverse_sql_order | Ernie Miller | 2011-06-20 | 1 | -3/+12 |
| |/ |/| | |||||
* | | Fix issue #1272 | Brian Mathiyakom | 2011-06-01 | 1 | -8/+7 |
| | | | | | | | | | | Set reverse_order_value when asked to reverse_order(). Do the actual reversal in build_arel. | ||||
* | | Ensure that calculations properly override the select value even if it's set ↵ | Jon Leighton | 2011-05-31 | 1 | -2/+2 |
| | | | | | | | | in the default scope. Fixes #1395. | ||||
* | | Merge branch 'master' of git://github.com/lifo/docrails | Xavier Noria | 2011-05-25 | 2 | -5/+5 |
|\ \ | |/ |/| | | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/core_ext/kernel/requires.rb | ||||
| * | Remove extra white spaces on ActiveRecord docs. | Sebastian Martinez | 2011-05-23 | 2 | -5/+5 |
| | | |||||
* | | Add support for passing mass assignment roles to dynamic finders. Closes #1170. | Andrew White | 2011-05-21 | 1 | -2/+2 |
| | | |||||
* | | Syntax cleanup: for in => each | Guillermo Iguaran | 2011-05-19 | 1 | -1/+1 |
|/ | |||||
* | Bug fixes: | Fadzril Muhamad & Joseph Palermo | 2011-05-12 | 1 | -5/+4 |
| | | | | | | - If doing a count on a relation that has an :include and a :join, it does a distinct even though it should not. - When doing a count on a relation that has an :include, it always falls back to a old style left join when performing the count. Looks like it was broken here: https://github.com/rails/rails/commit/b9599502c9e738a5a1513e75d08f8d40ed408265 | ||||
* | Merge pull request #451 from baroquebobcat/fixing_last_for_issue_371 | Jon Leighton | 2011-05-08 | 1 | -1/+6 |
|\ | |||||
| * | Fix for #371 | Nick Howard | 2011-05-08 | 1 | -1/+6 |
| | | | | | | | | | | | | | | | | | | | | | | | | if a query contains a limit or an offset, ActiveRecord::FinderMethods#find_last had inconsistent behavior. If the records were loaded, it returned the last record in the cached list. If they were not, it reversed the order of the query and changed the limit to one. If the earlier limit was less than the total matching the query in the db, it would return a different record than if the records had been cached. This commit changes find_last so that it loads the records when getting the last record on a query containing a limit or an offset, which makes the behavior consistent. | ||||
* | | Ensure that ORDER BY clauses from default scopes are not included in ↵ | Jon Leighton | 2011-05-08 | 1 | -1/+1 |
|/ | | | | calculation queries. Fixes #406. | ||||
* | supporting nil when passed in as an IN clause | Aaron Patterson | 2011-04-29 | 1 | -1/+12 |
| | |||||
* | deprecated the use of the guard_protected_attributes argument with ↵ | Josh Kalderimis | 2011-04-25 | 1 | -2/+2 |
| | | | | attributes= in AR in favor of assign_attributes(attrs, :without_protection => true) | ||||
* | stop using distinct on for the unique id queries. [#6450 state:resolved] | Aaron Patterson | 2011-04-21 | 1 | -0/+2 |
| | |||||
* | use index based substitution for bind parameters | Aaron Patterson | 2011-04-13 | 1 | -1/+1 |
| |