aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/finder_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Correct handling of complex order clauses with SQL Server limit emulation. ↵Jeremy Kemper2005-11-081-0/+10
| | | | | | Closes #2770. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added extension capabilities to has_many and has_and_belongs_to_many proxies ↵David Heinemeier Hansson2005-11-041-0/+14
| | | | | | [DHH] Added find_or_create_by_X as a second type of dynamic finder that'll create the record if it doesn't already exist [DHH] Added constrain scoping for creates using a hash of attributes bound to the :creation key [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed SQL Server adapter so it honors options[:conditions] when applying ↵David Heinemeier Hansson2005-10-281-0/+6
| | | | | | :limits (closes #1978) [Tom Ward] Fixed SQL Server adapter to pass even more tests and do even better (closes #2634) [rtomayko@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2781 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed handling of nil number columns on Oracle and cleaned up tests for ↵David Heinemeier Hansson2005-10-261-12/+6
| | | | | | Oracle in general #2555 [schoenm@earthlink.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2741 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added quoted_true and quoted_false methods to db2_adapter and cleaned up ↵David Heinemeier Hansson2005-10-261-1/+1
| | | | | | tests for DB2 (closes #2493) [maik schmidt] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r2718@asus: jeremy | 2005-10-23 14:45:30 -0700Jeremy Kemper2005-10-231-1/+1
| | | | | | | | | | | Ticket 2404 - fixture delete order r2719@asus: jeremy | 2005-10-23 15:01:13 -0700 Keep closer tabs on dirty, loaded, and declared fixtures. Closes #2404. r2720@asus: jeremy | 2005-10-23 16:09:19 -0700 ensure table names are strings. set dirty = dirty union loaded rather than dirty = loaded. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2714 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Clarify semantics of ActiveRecord::Base#respond_to? Closes #2560.Jeremy Kemper2005-10-221-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* modified finder test a tiny bit so that it passes on sqlserverTobias Lütke2005-10-161-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise an exception when invalid options are passed to ↵Marcel Molina2005-10-061-0/+5
| | | | | | ActiveRecord::Base.find. Closes #2363. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quote booleans according the rules defined by the adapterMichael Koziarski2005-10-061-2/+2
| | | | | | | | | | * SQLite schema has been updated * Postgresql schema needs to be fixed too Simplify AR::Base#toggle to store the boolean, not the quoted value * expand the tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Wrap :conditions in parentheses to prevent problems with OR's #1871Jamis Buck2005-09-241-1/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added AbstractAdapter#select_value and AbstractAdapter#select_values as ↵David Heinemeier Hansson2005-09-241-0/+13
| | | | | | convenience methods for selecting single values, instead of hashes, of the first column in a SELECT #2283 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added :select option to find which can specify a different value than the ↵David Heinemeier Hansson2005-07-141-0/+4
| | | | | | default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Base.content_columns call for SQL Server adapter #1450 [DeLynn Berry] ↵David Heinemeier Hansson2005-07-031-1/+5
| | | | | | And a bug with the offset rules git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Updated all references to the old find_first and find_all to use the new ↵David Heinemeier Hansson2005-06-261-1/+1
| | | | | | style #1511 [Marcel Molina] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1520 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed Base#find to honor the documentation on how :joins work and make them ↵David Heinemeier Hansson2005-06-251-2/+5
| | | | | | consistent with Base#count #1405 [pritchie@gmail.com] Improved dynamic finder docs #1495 [laurel@gorgorg.org] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that calling Model.find([]) returns [] and doesn't throw an exception ↵David Heinemeier Hansson2005-06-211-0/+4
| | | | | | #1379 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix quote_bound_value to not map Strings #1416 [htonl]David Heinemeier Hansson2005-06-161-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow any Enumerable, not just Array, to work as bind variables #1344 [bitsweat]David Heinemeier Hansson2005-06-161-1/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't expect fixtures to be returned in the order they were inserted.Jeremy Kemper2005-06-121-3/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Do not use instantiated fixtures (in general) in tests. Also, support the ↵Jamis Buck2005-06-101-14/+14
| | | | | | use of transactional fixtures by setting the AR_TX_FIXTURES environment variable to "yes". git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed use of construct_finder_sql when using :join #1288 [dwlt@dwlt.net]David Heinemeier Hansson2005-05-191-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1316 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added option for passing an array to the find_all version of the dynamic ↵David Heinemeier Hansson2005-05-021-0/+4
| | | | | | finders and have it evaluated as an IN fragment git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1266 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Made the dynamic finders use the new find API and updated the examples here ↵David Heinemeier Hansson2005-04-171-5/+10
| | | | | | and there git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added testsDavid Heinemeier Hansson2005-04-031-0/+278
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1078 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added new Base.find API and deprecated find_all, find_first. Added ↵David Heinemeier Hansson2005-04-031-283/+0
| | | | | | preliminary support for eager loading of associations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed the MS SQL adapter to work with the new limit/offset approach and with ↵David Heinemeier Hansson2005-03-231-5/+6
| | | | | | binary data (still suffering from 7KB limit, though) #901 [delynnb] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@982 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added adapter independent limit clause as a two-element array with the first ↵David Heinemeier Hansson2005-03-201-1/+28
| | | | | | being the limit, the second being the offset #795 [Sam Stephenson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@944 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.exists?(id) that'll return true if an object of the class with ↵David Heinemeier Hansson2005-03-171-0/+7
| | | | | | the given id exists #854 [stian@grytoyr.net] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that SQLite3 exceptions are caught and reported properly #823 [yerejm]David Heinemeier Hansson2005-03-141-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the dynamic finder like find_all_by_something_boolean(false) ↵David Heinemeier Hansson2005-02-181-0/+10
| | | | | | didn't work #649 [lmarlow@yahoo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added an Oracle adapter that works with the Oracle bindings by Yoshida ↵David Heinemeier Hansson2005-02-071-4/+10
| | | | | | (http://raa.ruby-lang.org/project/oracle/) #564 [Maik Schmidt] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that the dynamic finders didnt treat nil as a "IS NULL" but rather "= ↵David Heinemeier Hansson2005-01-241-0/+23
| | | | | | NULL" case #515 [Demetrius] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added bind-named arrays for interpolating a group of ids or strings in ↵David Heinemeier Hansson2005-01-241-1/+9
| | | | | | conditions #528 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@485 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added find_all style to the new dynamic findersDavid Heinemeier Hansson2005-01-021-0/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@308 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added dynamic attribute-based finders as a cleaner way of getting objects by ↵David Heinemeier Hansson2005-01-021-12/+22
| | | | | | simple queries without turning to SQL. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Restored bind arity checking #412 [bitsweat]David Heinemeier Hansson2005-01-021-2/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@306 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added that Base#find takes an optional options hash, including :conditions. ↵David Heinemeier Hansson2005-01-011-1/+33
| | | | | | Base#find_on_conditions deprecated in favor of #find with :conditions #407 [bitsweat] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@305 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that Base#find will return an array if given an array -- regardless of ↵David Heinemeier Hansson2004-12-151-1/+6
| | | | | | the number of elements #270 [Marten] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Base.validate_uniqueness thatv alidates whether the value of the ↵David Heinemeier Hansson2004-12-101-0/+10
| | | | | | specified attributes are unique across the system. Useful for making sure that only one user can be named "davidhh". git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@108 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added named bind-style variable interpolation #281 [Michael Koziarski]David Heinemeier Hansson2004-12-081-0/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@78 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added the option for sanitizing find_by_sql and the offset parts in regular ↵David Heinemeier Hansson2004-12-071-1/+36
| | | | | | finds [Sam Stephenson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@75 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed value quoting in all generated SQL statements, so that integers are ↵David Heinemeier Hansson2004-12-071-2/+2
| | | | | | not surrounded in quotes and that all sanitation are happening through the database's own quoting routine. This should hopefully make it lots easier for new adapters that doesn't accept '1' for integer columns. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@70 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added bind-style variable interpolation for the condition arrays that uses ↵David Heinemeier Hansson2004-12-071-0/+7
| | | | | | the adapter's quote method [Michael Koziarski] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@56 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* InitialDavid Heinemeier Hansson2004-11-241-0/+67
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de