Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Deprecate inferred JOINs with includes + SQL snippets. | Jon Leighton | 2012-01-16 | 1 | -3/+25 |
| | | | | | | See the CHANGELOG for details. Fixes #950. | ||||
* | store references as a string | Jon Leighton | 2012-01-16 | 1 | -1/+1 |
| | |||||
* | Make referencing an included item trigger eager loading | Jon Leighton | 2012-01-16 | 1 | -1/+2 |
| | |||||
* | Add ActiveRecord::Relation#references (#950) | Jon Leighton | 2012-01-16 | 1 | -1/+1 |
| | |||||
* | Revert "Deprecate implicit eager loading. Closes #950." | Jon Leighton | 2012-01-16 | 1 | -13/+1 |
| | | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9. | ||||
* | correctly handle order calls after a reorder | Matt Jones + Scott Walker | 2012-01-03 | 1 | -1/+1 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2011-12-29 | 1 | -1/+1 |
|\ | |||||
| * | typo | Jo Liss | 2011-12-28 | 1 | -1/+1 |
| | | |||||
* | | Deprecate implicit eager loading. Closes #950. | Jon Leighton | 2011-12-29 | 1 | -1/+13 |
|/ | |||||
* | AS::Concern is not really needed for AR::Explain | Xavier Noria | 2011-12-16 | 1 | -1/+1 |
| | |||||
* | Split out most of the AR::Base code into separate modules :cake: | Jon Leighton | 2011-12-15 | 1 | -1/+1 |
| | |||||
* | Set up delegations also for to_a and arel branches. | José Valim | 2011-12-15 | 1 | -7/+0 |
| | |||||
* | Move delegation reponsibilities of Relation to a module. Also precompile ↵ | José Valim | 2011-12-15 | 1 | -22/+1 |
| | | | | method missing calls for rofscale. | ||||
* | Make with_scope public so we stop using send :bomb: | José Valim | 2011-12-15 | 1 | -1/+1 |
| | |||||
* | Improve delegate list to avoid method missing. | José Valim | 2011-12-15 | 1 | -1/+2 |
| | |||||
* | There isn't a column_hash. It was being invoked by method missing. | José Valim | 2011-12-15 | 1 | -1/+1 |
| | |||||
* | implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria] | Xavier Noria | 2011-12-04 | 1 | -5/+5 |
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit vastly reduces the impact of auto explain logging when enabled, while keeping a negligible cost when disabled. The first implementation was based on the idea of subscribing to "sql.active_record" when needed, and unsubscribing once done. This is the idea behind AR::Relation#explain. Subscribe, collect, unsubscribe. But with the current implementation of notifications unsubscribing is costly, because it wipes an internal cache and that puts a penalty on the next event. So we are switching to an approach where a long-running subscriber is listening. Instead of collecting the queries with a closure in a dedicated subscriber, now we setup a thread local. If the feature is disabled by setting the threshold to nil, the subscriber will call a method that does nothing. That's totally cheap. | ||||
* | indentation fix warning | Arun Agrawal | 2011-12-02 | 1 | -1/+1 |
| | |||||
* | revises some details in the previous explain patch | Xavier Noria | 2011-12-02 | 1 | -1/+1 |
| | |||||
* | implements automatic EXPLAIN logging for slow queries | Xavier Noria | 2011-12-02 | 1 | -16/+29 |
| | |||||
* | add the query to AR::Relation#explain output | Xavier Noria | 2011-11-25 | 1 | -2/+3 |
| | | | | | | | Rationale: this is more readable if serveral queries are involved in one call. Also, it will be possible to let AR log EXPLAINs automatically in production mode, where queries are not even around. | ||||
* | implements AR::Relation#explain | Xavier Noria | 2011-11-05 | 1 | -0/+16 |
| | | | | | | | | | | | | | | | | | | | This is a first implementation, EXPLAIN is highly dependent on the database and I have made some compromises. On one hand, the method allows you to run the most common EXPLAIN and that's it. If you want EXPLAIN ANALYZE in PostgreSQL you need to do it by hand. On the other hand, I've tried to construct a string as close as possible to the ones built by the respective shells. The rationale is that IMO the user should feel at home with the output and recognize it at first sight. Per database. I don't know whether this implementation is going to work well. Let's see whether people like it. | ||||
* | Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query | Jon Leighton | 2011-11-05 | 1 | -1/+1 |
| | |||||
* | Revert "Raise error on unknown primary key." | Jon Leighton | 2011-10-05 | 1 | -3/+3 |
| | | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. | ||||
* | Raise error on unknown primary key. | Jon Leighton | 2011-10-05 | 1 | -3/+3 |
| | | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307. | ||||
* | Rename first_or_new to first_or_initialize. | Jon Leighton | 2011-09-13 | 1 | -2/+1 |
| | | | | | For consistency with find_or_initialize_by. Also remove first_or_build alias. | ||||
* | Using more precise method signatures for AR::Relation#first_or_create family ↵ | Andrés Mejía | 2011-09-06 | 1 | -6/+6 |
| | | | | of methods. | ||||
* | Adding first example with no arguments to AR::Relation#first_or_create and ↵ | Andrés Mejía | 2011-09-06 | 1 | -15/+15 |
| | | | | removing examples that create several users at the same time (this is confusing and not really helpful). | ||||
* | Adding first_or_create, first_or_create!, first_or_new and first_or_build to ↵ | Andrés Mejía | 2011-08-30 | 1 | -0/+43 |
| | | | | | | | | | | Active Record. This let's you write things like: User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true) Related to #2420. | ||||
* | Refactor building the update manager | Jon Leighton | 2011-08-15 | 1 | -5/+6 |
| | |||||
* | Support updates with joins. Fixes #522. | Jon Leighton | 2011-08-15 | 1 | -4/+9 |
| | |||||
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 1 | -7/+6 |
| | | | | 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. | ||||
* | Bring back the ability to provide :order for update_all. | thedarkone | 2011-07-25 | 1 | -9/+5 |
| | |||||
* | Foo.joins(:bar).includes(:bar) should result in a single query with :bar as ↵ | Jon Leighton | 2011-07-09 | 1 | -1/+11 |
| | | | | a join. Related: #1873. | ||||
* | Use Enumerable#with_index. We're on Ruby > 1.8.7 | Akira Matsuda | 2011-07-08 | 1 | -2/+1 |
| | |||||
* | Add require ActiveSupport delegation to ActiveRecord::Relation class. | Dmitriy Kiriyenko | 2011-07-07 | 1 | -0/+1 |
| | |||||
* | default create_with_value to a hash so we can eliminate conditionals, add ↵ | Aaron Patterson | 2011-06-27 | 1 | -2/+3 |
| | | | | test surrounding create_with(nil) behavior | ||||
* | Fix issue #1272 | Brian Mathiyakom | 2011-06-01 | 1 | -1/+1 |
| | | | | | Set reverse_order_value when asked to reverse_order(). Do the actual reversal in build_arel. | ||||
* | delegate connection and column_hash calls directly to model | Hemant Kumar | 2011-05-28 | 1 | -1/+1 |
| | |||||
* | Merge branch 'master' of git://github.com/lifo/docrails | Xavier Noria | 2011-05-25 | 1 | -2/+2 |
|\ | | | | | | | | | | | 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 | 1 | -2/+2 |
| | | |||||
* | | Fix infinite recursion where a lazy default scope references a scope. Fixes ↵ | Jon Leighton | 2011-05-25 | 1 | -1/+1 |
| | | | | | | | | #1264. | ||||
* | | Ensure that the surrounding code in Relation#to_a respects the default_scope ↵ | Jon Leighton | 2011-05-24 | 1 | -17/+24 |
|/ | | | | (as well as having Relation#arel respect the default scope). Fixes #1233. | ||||
* | using bind parameters for updates | Aaron Patterson | 2011-04-30 | 1 | -1/+1 |
| | |||||
* | postgresql supports prepare statement deletes | Aaron Patterson | 2011-04-29 | 1 | -1/+3 |
| | |||||
* | Use existing #empty_insert_statement_value for an insert with no columns. | Ken Collins | 2011-04-24 | 1 | -1/+1 |
| | |||||
* | The #substitute_at gets an ActiveRecord::ConnectionAdapters::Column in ↵ | Ken Collins | 2011-04-23 | 1 | -1/+1 |
| | | | | #insert to match replacement in #exec_query. | ||||
* | sort insert columns for better cache hits | Aaron Patterson | 2011-04-14 | 1 | -1/+1 |
| | |||||
* | refactoring inserts to use the same method on the connection | Aaron Patterson | 2011-04-14 | 1 | -21/+16 |
| | |||||
* | insert statements are prepared, but values are not escaped properly | Aaron Patterson | 2011-04-14 | 1 | -6/+24 |
| |