aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_record_querying.textile
Commit message (Collapse)AuthorAgeFilesLines
* document the AR none method [ci skip]Vijay Dev2012-02-011-0/+24
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-02-011-5/+5
|\
| * Improve readonly examples and optimistic locking docsCarlos Antonio da Silva2012-01-311-5/+5
| | | | | | | | | | | | | | | | | | * Relation#order can receive order attributes as different arguments, add example; * Readonly does not handle deletion of records, only modification; * locking_version column does not need to default to 0, Rails handles nil values; * Change references from "set_locking_column" to "self.locking_column".
* | disable automatic explain if there is no logger [closes #4671]Xavier Noria2012-01-261-0/+3
|/
* fix some examples - method names can't start with a numberVijay Dev2012-01-241-5/+5
|
* Add ActiveRecord::Base#with_lockOlek Janiszewski2012-01-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a `with_lock` method to ActiveRecord objects, which starts a transaction, locks the object (pessimistically) and yields to the block. The method takes one (optional) parameter and passes it to `lock!`. Before: class Order < ActiveRecord::Base def cancel! transaction do lock! # ... cancelling logic end end end After: class Order < ActiveRecord::Base def cancel! with_lock do # ... cancelling logic end end end
* [docs] Added missing "}" fixes #4126Arun Agrawal2011-12-221-1/+1
|
* removes the convenience instance version of AR::Base.silence_auto_explainXavier Noria2011-12-031-3/+2
| | | | | | | Rationale: As discussed with José and Jon, this convenience shortcut is not clearly justified and it could let the user thing the disabled EXPLAINs are related to the model instance rather than being globally disabled.
* fix a typo in query guideVijay Dev2011-12-031-1/+1
|
* two small details from the previous patchXavier Noria2011-12-021-1/+1
|
* implements AR::Base(.|#)silence_auto_explainXavier Noria2011-12-021-0/+37
|
* expand on pluck docsVijay Dev2011-12-011-3/+18
|
* ActiveRecord::Relation#pluck methodBogdan Gusiev2011-11-301-0/+9
|
* finders guide: adds some pointers to help users interpret the output of EXPLAINXavier Noria2011-11-251-0/+11
|
* add the query to AR::Relation#explain outputXavier Noria2011-11-251-0/+5
| | | | | | | 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.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2011-11-081-10/+10
|\ | | | | | | | | Conflicts: railties/guides/source/active_record_querying.textile
| * fix markups for plus in AR guideVijay Dev2011-11-061-10/+10
| |
* | adds trailing +s to the output of EXPLAIN for MySQLXavier Noria2011-11-071-6/+6
|/
* implements AR::Relation#explainXavier Noria2011-11-051-0/+65
| | | | | | | | | | | | | | | | | | | 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 queryJon Leighton2011-11-051-4/+20
|
* quoting 'and' to make it more distinct.Craig Monson2011-10-121-1/+1
|
* Heavy copy editing of the find_each and find_in_batches sectionmhutchin2011-10-111-26/+34
|
* Undid previous change which violated the convention regarding output (use "# ↵Manuel Menezes de Sequeira2011-10-061-13/+13
| | | | =>") used in these guides. Corrected typo in previous correction. (Thanks for pointing this out, vijaydev.)
* Some small corrections and improvements to the text.Manuel Menezes de Sequeira2011-10-051-30/+32
|
* Corrected a typo.Michael Hutchinson2011-09-271-1/+1
|
* No more changelogs inside guidesVijay Dev2011-09-151-9/+0
|
* change first_or_new to first_or_initialize as per 11870117, and some editsVijay Dev2011-09-141-10/+12
|
* Merge pull request #2757 from andmej/first_or_create_pull_requestJon Leighton2011-09-081-7/+68
|\ | | | | Add first_or_create family of methods to Active Record
| * Adding `first_or_new` documentation to the AR Querying guide.Nicolas Hock Isaza2011-08-301-1/+1
| |
| * Adding first_or_create, first_or_create!, first_or_new and first_or_build to ↵Andrés Mejía2011-08-301-7/+68
| | | | | | | | | | | | | | | | | | | | 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.
* | some of the changes for validation earlier reverted from d20281aVijay Dev2011-09-031-2/+2
|/
* fixes generation of the AR querying guideXavier Noria2011-08-171-2/+2
|
* document the change in edge rails which makes a more strict check on the ↵Vijay Dev2011-07-231-0/+1
| | | | arity of the dynamic finders
* Updated active_record_querying.textile: intro paragraph of 'Conditions' to ↵Christopher Scott Hernandez2011-07-081-1/+1
| | | | change 'find method' to 'where method'
* correct invalid HAVING queryAkira Matsuda2011-06-291-3/+3
| | | | | * GROUP BY value must appear in SELECT clause * ("created_at < ?", 1.month.ago) wasn't a very good example for HAVING. you'd better use WHERE for such a simple condition
* correct invalid GROUP BY queryAkira Matsuda2011-06-291-2/+2
| | | | GROUP BY value must appear in SELECT clause
* minor indentation fixes on a6293ffVijay Dev2011-06-261-10/+10
|
* Update changelog for querying guideRyan Bigg2011-06-261-1/+2
|
* Querying guide: add mention of scoped, unscoped and default_scope to ↵Ryan Bigg2011-06-261-0/+41
| | | | querying guide
* document Active Record's reverse_order methodVijay Dev2011-06-201-0/+27
|
* Fix incorrect description of the returned results.Ben Orenstein2011-05-271-2/+2
|
* Copy edits 64148ab96b47a9904fdd839bc69971b4e156bb04 (previous commit). ↵Ben Orenstein2011-05-261-1/+1
| | | | Please squash at will.
* Improve 'Joining Tables' section with additional examples and explanation.Ben Orenstein2011-05-261-1/+29
|
* Don't you lie to me!Ben Orenstein2011-05-261-2/+2
|
* document the reorder method(fb215110401c70cfc7013c6e2ad5753fa4e374e9)Vijay Dev2011-04-281-4/+31
|
* Exception got moved to ActiveModel with Rails 3Eric Anderson2011-04-201-1/+1
|
* Remove extra whitespaces from guidesSebastian Martinez2011-04-141-2/+2
|
* Making colon usage consistentMatt Duncan2011-04-131-1/+1
|
* fix example queryVijay Dev2011-04-061-1/+1
|
* Delegate first!, last!, any? and many? to scopedAndrew White2011-03-291-0/+20
|