Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | | | | | do not keep a reference to the chain in the callback objects | Aaron Patterson | 2013-05-10 | 1 | -12/+10 | |
| | | | | | | ||||||
* | | | | | | fix deprecation test | Aaron Patterson | 2013-05-10 | 1 | -0/+2 | |
| | | | | | | ||||||
* | | | | | | push merge code to the callback itself | Aaron Patterson | 2013-05-10 | 1 | -18/+10 | |
| | | | | | | ||||||
* | | | | | | dup the callback and set the chain | Aaron Patterson | 2013-05-10 | 1 | -8/+8 | |
| | | | | | | ||||||
* | | | | | | remove klass because it is not used | Aaron Patterson | 2013-05-10 | 1 | -9/+7 | |
| | | | | | | ||||||
* | | | | | | rename instance variables | Aaron Patterson | 2013-05-10 | 1 | -12/+14 | |
| | | | | | | ||||||
* | | | | | | push duplicates? logic to the instance | Aaron Patterson | 2013-05-10 | 1 | -16/+7 | |
| | | | | | | ||||||
* | | | | | | callback chain is in charge of the cache, so remove method based cache | Aaron Patterson | 2013-05-10 | 1 | -21/+0 | |
| | | | | | | ||||||
* | | | | | | __define_callbacks method is not necessary anymore | Aaron Patterson | 2013-05-10 | 1 | -8/+1 | |
| | | | | | | ||||||
* | | | | | | just run compiled callbacks since they are cached | Aaron Patterson | 2013-05-10 | 1 | -14/+4 | |
| | | | | | | ||||||
* | | | | | | cache compiled callbacks | Aaron Patterson | 2013-05-10 | 1 | -7/+27 | |
| | | | | | | ||||||
* | | | | | | use delegation over inheritance so we can figure when to cache / bust cache | Aaron Patterson | 2013-05-10 | 1 | -5/+22 | |
| | | | | | | ||||||
* | | | | | | fixing activemodel tests | Aaron Patterson | 2013-05-10 | 1 | -1/+2 | |
| | | | | | | ||||||
* | | | | | | use an environment object to hold state about the filter calls | Aaron Patterson | 2013-05-10 | 1 | -21/+41 | |
| | | | | | | ||||||
* | | | | | | object based callbacks cannot be duplicated | Aaron Patterson | 2013-05-10 | 1 | -7/+4 | |
| | | | | | | ||||||
* | | | | | | pass the run block as a normal variable to the rest of the callbacks | Aaron Patterson | 2013-05-10 | 1 | -12/+12 | |
| | | | | | | ||||||
* | | | | | | fixing more variable names | Aaron Patterson | 2013-05-10 | 1 | -10/+10 | |
| | | | | | | ||||||
* | | | | | | fix variable name | Aaron Patterson | 2013-05-10 | 1 | -6/+6 | |
| | | | | | | ||||||
* | | | | | | reduce the number of lambas | Aaron Patterson | 2013-05-10 | 1 | -5/+2 | |
| | | | | | | ||||||
* | | | | | | callback sequence is no longer used | Aaron Patterson | 2013-05-10 | 1 | -6/+0 | |
| | | | | | | ||||||
* | | | | | | no need for variable assignments, just pass the values in | Aaron Patterson | 2013-05-10 | 1 | -6/+2 | |
| | | | | | | ||||||
* | | | | | | make_lambda is never called with an Array | Aaron Patterson | 2013-05-10 | 1 | -2/+0 | |
| | | | | | | ||||||
* | | | | | | callbacks are wrapped with lambdas | Aaron Patterson | 2013-05-10 | 3 | -108/+78 | |
| | | | | | | ||||||
* | | | | | | remove dead code | Aaron Patterson | 2013-05-10 | 1 | -10/+0 | |
| | | | | | | ||||||
* | | | | | | fix method names | Aaron Patterson | 2013-05-10 | 1 | -40/+44 | |
| | | | | | | ||||||
* | | | | | | using lambas for the callback bodies | Aaron Patterson | 2013-05-10 | 1 | -32/+12 | |
| | | | | | | ||||||
* | | | | | | wrap all options in lambas | Aaron Patterson | 2013-05-10 | 1 | -7/+13 | |
| | | | | | | ||||||
* | | | | | | conditions in callbacks return consistent lambdas | Aaron Patterson | 2013-05-10 | 1 | -9/+43 | |
|/ / / / / | ||||||
* | | | | | Merge pull request #10558 from Empact/cleanup-finder-methods | Rafael Mendonça França | 2013-05-10 | 4 | -28/+25 | |
|\ \ \ \ \ | | | | | | | | | | | | | Cleanup finder methods | |||||
| * | | | | | Extract JoinDependency#join_relation to DRY the repeated application of the ↵ | Ben Woosley | 2013-05-10 | 3 | -7/+9 | |
| | | | | | | | | | | | | | | | | | | | | | | | | #join_associations. | |||||
| * | | | | | In #apply_join_dependency, we can apply the #where in-place because relation ↵ | Ben Woosley | 2013-05-10 | 1 | -1/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is always a new object. Thanks to the #except we call at the top of the method. | |||||
| * | | | | | DRY-up join dependency creation by extracting construct_join_depdency | Ben Woosley | 2013-05-10 | 1 | -7/+5 | |
| | | | | | | ||||||
| * | | | | | Pull the excepts into apply_join_dependency, for the sake of DRY. | Ben Woosley | 2013-05-10 | 1 | -3/+4 | |
| | | | | | | ||||||
| * | | | | | Simplify conditions within apply_join_dependency | Ben Woosley | 2013-05-10 | 1 | -9/+5 | |
| | | | | | | ||||||
| * | | | | | Move the except(:select) inside the construct_limited_ids_condition method ↵ | Ben Woosley | 2013-05-10 | 1 | -2/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | to pair it closely with its motivation. | |||||
| * | | | | | Reject blank order_values within #columns_for_distinct, as the orders aren't ↵ | Ben Woosley | 2013-05-10 | 2 | -3/+3 | |
|/ / / / / | | | | | | | | | | | | | | | | used at all on non-postgres adapters. | |||||
* | | | | | Move #proxy_association method to AssociationRelation | Jon Leighton | 2013-05-10 | 3 | -4/+6 | |
| | | | | | ||||||
* | | | | | Merge pull request #6792 from Empact/postgres-distinct | Jon Leighton | 2013-05-10 | 5 | -12/+61 | |
|\ \ \ \ \ | | | | | | | | | | | | | Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT" | |||||
| * | | | | | Fix that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT" | Ben Woosley | 2013-05-10 | 5 | -12/+61 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The combination of a :uniq => true association and the #distinct call in #construct_limited_ids_condition combine to create invalid SQL, because we're explicitly selecting DISTINCT, and also sending #distinct on to AREL, via the relation#distinct_value. Rather than build a select distinct clause in #construct_limited_ids_condition, I set #distinct! and pass just the columns into the select statement. This requires introducing a #columns_for_distinct method to return the select columns but not the statement itself. | |||||
* | | | | | | Merge pull request #10553 from dasch/dasch/dont-try-to-explain-select_db | Xavier Noria | 2013-05-10 | 2 | -1/+6 | |
|\ \ \ \ \ \ | | | | | | | | | | | | | | | Don't try to EXPLAIN select_db calls | |||||
| * | | | | | | Don't try to EXPLAIN select_db calls | Daniel Schierbeck | 2013-05-10 | 2 | -1/+6 | |
|/ / / / / / | ||||||
* | | | | | | Merge pull request #10543 from vipulnsward/to_sort | Carlos Antonio da Silva | 2013-05-10 | 1 | -1/+1 | |
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | Can you improve the commit message a little bit? It's good to describe why the change is happening. | |||||
| * | | | | | sort => sort! on new array | Vipul A M | 2013-05-10 | 1 | -1/+1 | |
| | | | | | | ||||||
* | | | | | | Set the inverse when association queries are refined | Jon Leighton | 2013-05-10 | 4 | -1/+33 | |
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose Man has_many interests, and inverse_of is used. Man.first.interests.first.man will correctly execute two queries, avoiding the need for a third query when Interest#man is called. This is because CollectionAssociation#first calls set_inverse_instance. However Man.first.interests.where("1=1").first.man will execute three queries, even though this is obviously a subset of the records in the association. This is because calling where("1=1") spawns a new Relation object from the CollectionProxy object, and the Relation has no knowledge of the association, so it cannot set the inverse instance. This commit solves the problem by making relations spawned from CollectionProxies return a new Relation subclass called AssociationRelation, which does know about associations. Records loaded from this class will get the inverse instance set properly. Fixes #5717. Live commit from La Conf! :sparkles: | |||||
* | | | | | Merge pull request #10510 from think602/master | Xavier Noria | 2013-05-09 | 1 | -0/+1 | |
|\ \ \ \ \ | |/ / / / |/| | | | | [ci skip] document protect_against_forgery? method | |||||
| * | | | | [ci skip] document protect_against_forgery? method | Weston Platter | 2013-05-10 | 1 | -0/+1 | |
| | | | | | ||||||
* | | | | | Merge pull request #10535 from vipulnsward/remove_var | Carlos Antonio da Silva | 2013-05-09 | 1 | -1/+0 | |
|\ \ \ \ \ | | | | | | | | | | | | | remove redundant var | |||||
| * | | | | | remove redundant var | Vipul A M | 2013-05-09 | 1 | -1/+0 | |
| | | | | | | ||||||
* | | | | | | Merge pull request #10536 from vipulnsward/fix_exp_warning | Carlos Antonio da Silva | 2013-05-09 | 1 | -1/+0 | |
|\ \ \ \ \ \ | | | | | | | | | | | | | | | remove variable and fix warning | |||||
| * | | | | | | remove variable and fix warning | Vipul A M | 2013-05-09 | 1 | -1/+0 | |
| |/ / / / / |