Commit Graph

319 Commits

Author SHA1 Message Date
Rick Olson
ea25e246e0 Quit ignoring default :include options in has_many :through calls [Mark James]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-19 16:13:52 +00:00
Rick Olson
fcd4c9529c Allow has_many :through associations to find the source association by setting a custom class (closes #4307) [jonathan@bluewire.net.nz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-19 07:14:48 +00:00
David Heinemeier Hansson
389a667664 Small pgsql fixes (closes #4083) [pergesu@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3965 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-19 02:21:58 +00:00
Rick Olson
0925c6b6a0 Allow has_many :through to work on has_many associations (closes #3864) [sco@scottraymond.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3964 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-19 02:01:40 +00:00
Rick Olson
57af961a80 Raise error when trying to select many polymorphic objects with has_many :through or :include (closes #4226) [josh@hasmanythrough.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3961 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-19 00:53:24 +00:00
Rick Olson
9c9069a675 Fixed has_many :through to include :conditions set on the :through association. closes #4020 [jonathan@bluewire.net.nz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 23:14:31 +00:00
Rick Olson
fbd1e01bd6 Fix that has_many :through honors the foreign key set by the belongs_to association in the join model (closes #4259) [andylien@gmail.com / Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3954 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 22:38:49 +00:00
David Heinemeier Hansson
9db8f3e57a SQL Server adapter gets some love (closes #4298) [rtomayko@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3949 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 21:27:40 +00:00
Jamis Buck
3257a4b9b0 Fix incorrect mysql column type (requires AR test DB to be rebuilt) (closes #4299)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 20:33:00 +00:00
David Heinemeier Hansson
e18fad6c43 Update lingering uses of deprecated association dependency options (closes #4169) [coffe2code]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3941 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 20:25:50 +00:00
Rick Olson
50103b86e6 fixed has_many :conditions sanitizing (closes #4278) [hakuja@hakuja.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 18:01:50 +00:00
David Heinemeier Hansson
416385a09d Added OpenBase database adapter that builds on top of the http://www.spice-of-life.net/ruby-openbase/ driver. All functionality except LIMIT/OFFSET is supported (closes #3528) [derrickspell@cdmplus.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 16:50:25 +00:00
David Heinemeier Hansson
df97ed5e4c Nicer error message on has_many :through when :through reflection can not be found (closes #4042) [court3nay@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 03:39:18 +00:00
David Heinemeier Hansson
ea617708c2 Added migrations support to the Sybase adapter (closes #4293) [John R. Sheets]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-18 03:02:32 +00:00
Rick Olson
a3502c419e Use association's :conditions when eager loading. [jeremyevans0@gmail.com] closes #4144
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 06:17:54 +00:00
Rick Olson
a0c459bca7 fix test_find_in_association_with_options test, tweak other tests affected by developer/project addition
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 03:24:40 +00:00
Rick Olson
def746030c Added Base.abstract_class? that marks which classes are not part of the Active Record hierarchy. closes #3704
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3882 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 02:46:01 +00:00
Rick Olson
0859779d6f Allow :dependent options to be used with polymorphic joins. #3820 [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-16 02:10:11 +00:00
Michael Koziarski
eccf39203f Correct syntax error in postgresql schema definition
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3868 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-15 01:31:00 +00:00
Jamis Buck
b95b09f32d a few more tests for the custom counter_cache naming code
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-09 18:11:41 +00:00
Jamis Buck
87898badba Allow counter_cache to accept a column name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3825 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-09 17:23:57 +00:00
David Heinemeier Hansson
4f00c70580 Fixed eager loading problems with single-table inheritance [Rick Olson] Added smarter table aliasing for eager associations for multiple self joins [Rick Olson] (closes #3580)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-05 18:43:56 +00:00
David Heinemeier Hansson
3dcf7fe4e9 Fixed that Date was in incorrect format in tasks.yml (closes #4072) [mlaster@metavillage.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3758 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-04 17:17:43 +00:00
Jamis Buck
964b67dd0e Make counter_cache work with polymorphic belongs_to
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3756 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-04 15:11:17 +00:00
David Heinemeier Hansson
b0245a57d6 No longer needed (closes #4017)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-02 02:54:34 +00:00
David Heinemeier Hansson
6a3f4c932a Added Sybase database adapter that relies on the Sybase Open Client bindings (see http://raa.ruby-lang.org/project/sybase-ctlib) (closes #3765) [John Sheets]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3734 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-02 01:15:41 +00:00
David Heinemeier Hansson
631181ca18 Renamed the "oci" adapter to "oracle", but kept the old name as an alias (closes #4017) [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-03-01 16:01:53 +00:00
Jeremy Kemper
1b3bae967d Add missing fixtures for #3937.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3700 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-28 17:46:16 +00:00
David Heinemeier Hansson
b56cac56dd Added new column to all db definitions. Where, oh where, is our hereo that will convert all the legacy fixture schemas to schema.rb? (closes #3993) [Bob Silva]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3695 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-28 04:23:44 +00:00
Nicholas Seckar
ada11d6313 Add set_fixture_class to allow the use of table name accessors with models which use set_default_name. Closes #3935
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3690 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-27 20:29:28 +00:00
David Heinemeier Hansson
c350291ae7 Fixed that reflections would bleed across class boundaries in single-table inheritance setups (closes #3796) [lars@pind.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3650 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-25 23:32:24 +00:00
David Heinemeier Hansson
99307b959b Added calculations: Base.count, Base.average, Base.sum, Base.minimum, Base.maxmium, and the generic Base.calculate. All can be used with :group and :having. Calculations and statitics need no longer require custom SQL. #3958 [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3646 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-25 23:06:04 +00:00
Jeremy Kemper
c7d6d68f91 Reflections don't attempt to resolve module nesting of association classes. Simplify type computation.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3637 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-22 18:44:14 +00:00
David Heinemeier Hansson
7a2ce50a93 Improved the Oracle OCI Adapter with better performance for column reflection (from #3210), fixes to migrations (from #3476 and #3742), tweaks to unit tests (from #3610), and improved documentation (from #2446) (closes #3879) [Aggregated by schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3623 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-21 00:00:29 +00:00
Michael Koziarski
b9a9893d2b Fix Syntax error in mysql.sql, Drop table readers and run aaa_create_tables first. [Bob Silva] Closes #3798
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3568 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-10 21:32:25 +00:00
Michael Koziarski
06170516c3 Add missing models and fixture
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3567 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-10 06:53:34 +00:00
Michael Koziarski
5f4b66201e Allow has_many :through to work with :include [Michael Schoen]. Closes #3611
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3566 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-10 05:19:41 +00:00
Jeremy Kemper
d424674f1b SQL Server cannot sort on type text. This causes three errors in the activerecord test suite, where tests sort on the comments.body or posts.body columns. This patch changes these columns from text to varchar(4096), allowing these tests to proceed (and pass). All activerecord tests now pass under sqlserver. References #3581. [Tom Ward]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3559 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-09 19:41:32 +00:00
Jeremy Kemper
b3065a51a9 Polymorphic join support for has_one associations (has_one :foo, :as => :bar). Closes #3785.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3558 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-09 19:37:05 +00:00
Jeremy Kemper
5991e5c789 PostgreSQL: correctly parse negative integer column defaults. References #3776.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-02-09 18:06:29 +00:00
Marcel Molina
297618bddc Make dynamic finders honor additional passed in :conditions. Closes #3569.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3463 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-22 09:34:41 +00:00
David Heinemeier Hansson
1facce6c24 allow has_many :through to work with custom :foreign key (closes #3422) [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-21 23:40:20 +00:00
Jamis Buck
f9c13e6134 Add a test to verify correct behavior when creating a polymorphic association
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-20 21:51:48 +00:00
Michael Koziarski
a471e6b4d7 allow the 'lock_version' column to be configured with set_locking_column. Closes #3402
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3422 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-14 09:36:52 +00:00
Marcel Molina
a5708b4c1f Multiple enhancements and adjustments to DB2 adaptor. Closes #3377.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-04 04:17:23 +00:00
Marcel Molina
bbec3ae512 Sanitize scoped conditions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3379 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2006-01-04 03:43:28 +00:00
Tobias Lütke
581f12b7b1 removed :piggyback in favor of just allowing :select on :through associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-20 21:26:27 +00:00
Tobias Lütke
1d2c6ee8f3 added :piggyback option to has_many :through relationships to pick up values from the join table as needed
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3323 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-20 20:32:47 +00:00
Tobias Lütke
5f06c483ca Fixed :through relations when using STI inherited classes would use the inherited class's name as foreign key on the join model
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-16 23:24:58 +00:00
David Heinemeier Hansson
e5d9ad3e29 Added option inheritance for find calls on has_and_belongs_to_many and has_many assosociations [DHH] Added option to specify :group, :limit, :offset, and :select options from find on has_and_belongs_to_many and has_many assosociations [DHH]
Added form_remote_for (form_for meets form_remote_tag) [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3287 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-13 00:39:51 +00:00
David Heinemeier Hansson
6427db6baa Added tests for join models and fixed a bug #3177
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-11 18:06:51 +00:00
Jeremy Kemper
d496db1388 Reloading an instance refreshes its aggregations as well as its associations. References #3024.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3242 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-08 04:46:57 +00:00
Jeremy Kemper
c1537e89f8 PostgreSQL: more robust sequence name discovery. References #3087.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-08 04:34:26 +00:00
David Heinemeier Hansson
6abda696b5 Added preliminary support for join models [DHH] Added preliminary support for polymorphic associations [DHH] Refactored associations to use reflections to get DRYer, beware, major refactoring -- double check before deploying anything with this (all tests pass, but..)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-03 04:29:55 +00:00
David Heinemeier Hansson
57b7532b91 Work-in progress for providing better join model support and polymorphic associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-12-02 06:03:43 +00:00
Jeremy Kemper
9cb02c5317 r3116@asus: jeremy | 2005-11-16 00:17:06 -0800
Introducing the Firebird adapter.  Closes #1874.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3052 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-16 08:18:13 +00:00
Jeremy Kemper
2076dca63f r3095@asus: jeremy | 2005-11-15 22:40:51 -0800
Ticket #1874 - Firebird adapter
 r3107@asus:  jeremy | 2005-11-16 00:06:14 -0800
 quote column aliases
 r3108@asus:  jeremy | 2005-11-16 00:08:12 -0800
 quote columns in construct_conditions_from_arguments.  update sequence_name docs.  introduce prefetched primary keys.
 r3109@asus:  jeremy | 2005-11-16 00:09:08 -0800
 double-quote rather than single-quote sqlite columns
 r3110@asus:  jeremy | 2005-11-16 00:09:56 -0800
 quote column names and use attribute_condition in validates_uniqueness_of
 r3111@asus:  jeremy | 2005-11-16 00:12:24 -0800
 Use QUOTED_TYPE constant in tests
 r3112@asus:  jeremy | 2005-11-16 00:13:28 -0800
 restrict test_inserts_with_pre_and_suffix to those adapters which support migrations
 r3113@asus:  jeremy | 2005-11-16 00:14:09 -0800
 Use QUOTED_TYPE constant in tests
 r3114@asus:  jeremy | 2005-11-16 00:14:30 -0800
 Use QUOTED_TYPE constant in tests


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-16 08:16:54 +00:00
Jeremy Kemper
d28e9aef5f Oracle: test case for column default parsing. References #2788.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3019 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-14 04:51:54 +00:00
Jeremy Kemper
b84a7beb98 acts_as_list plays nicely with inheritance by remembering the class which declared it. Closes #2811.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2964 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-10 06:19:50 +00:00
David Heinemeier Hansson
bc7ec23f4e Fixed acts_as_list for definitions without an explicit :order #2803 [jonathan@bluewire.net.nz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2951 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-09 12:50:35 +00:00
Jeremy Kemper
35b4bdcff0 Destroy associated has_and_belongs_to_many records after all before_destroy callbacks but before destroy. This allows you to act on the habtm association as you please while preserving referential integrity. Closes #2065.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2940 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-08 10:19:09 +00:00
Jeremy Kemper
5298f730bb Add :order option to Author.posts_with_comments_and_categories so that tests which assume implicit id order pass with database which do not provide it. Scrubbed whitespace.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2934 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-08 04:36:37 +00:00
David Heinemeier Hansson
49c801b71d Added :include as an option for association declarations [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2898 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-06 20:39:34 +00:00
David Heinemeier Hansson
c8dd66fdcd Made association extensions use simpler block syntax
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-06 19:05:42 +00:00
David Heinemeier Hansson
a5a82d978b Added extension capabilities to has_many and has_and_belongs_to_many proxies [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
2005-11-04 19:39:50 +00:00
Jeremy Kemper
56ade75131 Explicitly require topic from reply fixture.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2867 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-04 05:46:28 +00:00
David Heinemeier Hansson
8c512a1caf Added extension capabilities to has_many and has_and_belongs_to_many proxies [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2861 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-11-03 09:06:42 +00:00
Florian Weber
d5859d0b17 Added that an DuplicateMigrationVersionError gets raised when multiple migrations have the same version number.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2832 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-31 15:43:02 +00:00
David Heinemeier Hansson
e508595cf7 Fixed SQL Server adapter so it honors options[:conditions] when applying :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
2005-10-28 09:20:05 +00:00
David Heinemeier Hansson
dd257a3ccb Fixed handling of nil number columns on Oracle and cleaned up tests for Oracle in general #2555 [schoenm@earthlink.net]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2741 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-26 12:57:11 +00:00
David Heinemeier Hansson
85a7892644 Added quoted_true and quoted_false methods to db2_adapter and cleaned up tests for DB2 (closes #2493) [maik schmidt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2739 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-26 12:47:23 +00:00
Tobias Lütke
13fccff283 modified finder test a tiny bit so that it passes on sqlserver
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-16 20:50:06 +00:00
Jeremy Kemper
7117fdb8ce r3616@asus: jeremy | 2005-09-26 23:09:28 -0700
Ticket 2292 - Sequences, schemas, and fixtures
 r3917@asus:  jeremy | 2005-10-15 10:43:24 -0700
 fix pk assert
 r3918@asus:  jeremy | 2005-10-15 10:46:52 -0700
 rework query cache connection= override
 r3919@asus:  jeremy | 2005-10-15 10:47:45 -0700
 correct fixtures usage
 r3920@asus:  jeremy | 2005-10-15 10:53:23 -0700
 correct attr assignment
 r3921@asus:  jeremy | 2005-10-15 12:59:10 -0700
 sequences
 r3922@asus:  jeremy | 2005-10-15 16:36:09 -0700
 reset fixtures work with sequences
 r3951@asus:  jeremy | 2005-10-15 23:23:12 -0700
 cut down excess features
 r3952@asus:  jeremy | 2005-10-15 23:40:30 -0700
 don't test for PostgreSQL specifically


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2639 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-16 03:45:39 +00:00
Jeremy Kemper
da675e536d Support ordered YAML fixtures. #1896
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2600 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-15 02:01:38 +00:00
Tobias Lütke
7086993161 Adds :nullify option to :depends. Closes #2015 (Robby Russell)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2595 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-15 00:46:55 +00:00
Marcel Molina
af0df03fd3 Update DB2 adapter. Closes #2206.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-12 23:42:54 +00:00
Marcel Molina
f0b2b637ea Add test coverage for customized primary keys including a failing test for #2444.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-12 19:55:46 +00:00
Marcel Molina
e30699f660 Add geometric type for postgresql adapter. Closes #2233.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-09 00:52:25 +00:00
Jeremy Kemper
bcb50f3c89 sqlite topics.approved should default to true like the other dbs
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2480 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-06 21:52:47 +00:00
Jeremy Kemper
164625ca1f Fixup tests for [2474].
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-06 17:13:24 +00:00
Jeremy Kemper
78d6cc085a smallint -> boolean in pg sql
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2475 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-10-06 04:52:32 +00:00
Michael Koziarski
656fb866f9 Quote booleans according the rules defined by the adapter
* 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
2005-10-06 04:15:14 +00:00
Jeremy Kemper
efaf2af07c r3653@asus: jeremy | 2005-09-28 00:23:49 -0700
Ticket 2221 - model.association.clear should destroy associated objects if :dependent => true instead of nullifying their foreign keys


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2384 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-28 03:52:57 +00:00
Jeremy Kemper
0bd11857ef Ticket 2256 - Recognize PostgreSQL NOW() default as equivalent to CURRENT_TIMESTAMP/CURRENT_DATE
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2378 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-27 23:37:57 +00:00
Jeremy Kemper
79a535ecd7 r3589@asus: jeremy | 2005-09-26 16:58:40 -0700
Remove associations.png in favor of flower.jpg which reveals a bug in binary escaping.


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 20:28:55 +00:00
Jeremy Kemper
b2c46ed5fd Include the orders table in *.drop.sql
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2342 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-26 08:23:04 +00:00
Jamis Buck
ea65465422 Standardize the interpretation of boolean columns in the Mysql and Sqlite adapters. (Use MysqlAdapter.emulate_booleans = false to disable this behavior)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2335 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-25 15:49:35 +00:00
Jamis Buck
2a35baa0bb Wrap :conditions in parentheses to prevent problems with OR's #1871
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-24 23:58:13 +00:00
David Heinemeier Hansson
4307d7ecbe Fixed various problems with has_and_belongs_to_many when using customer finder_sql #2094 [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2233 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-13 10:15:54 +00:00
David Heinemeier Hansson
4b53e26ef6 Fix fixture problem for pgsql
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-11 04:18:07 +00:00
David Heinemeier Hansson
e5cc729b18 Make the test_find_all_by_one_attribute and test_find_all_by_one_attribute_with_options tests not fail in SQL Server #2128 [Tom Ward]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-09 08:34:51 +00:00
David Heinemeier Hansson
b063067321 Added the instance methods #root and #ancestors on acts_as_tree and fixed siblings to not include the current node #2142, #2140 [coffee2code]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2163 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-09-09 08:01:44 +00:00
Jamis Buck
dfe1aeb776 Saving a record with two unsaved belongs_to associations pointing to the same object fails #2023 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2040 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-08-23 11:05:04 +00:00
David Heinemeier Hansson
14ea312808 Made Oracle a first-class connection adapter by adhering closer to idiomatic Oracle style #1798 [The Gang of Oracles]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-24 14:01:35 +00:00
David Heinemeier Hansson
34f9d30e39 Added support for calling constrained class methods on has_many and has_and_belongs_to_many collections #1764 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-22 20:05:42 +00:00
Jamis Buck
83e2f6ae1e Allow unspecified join-table columns to use to their default values when adding to a habtm collection
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1860 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-18 11:06:41 +00:00
David Heinemeier Hansson
9870396ed1 Fixed incompatibility in DB2 adapter with the new limit/offset approach #1718 [Maik Schmidt]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1850 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-17 09:52:00 +00:00
David Heinemeier Hansson
f1880cac58 Sugared up migrations with even more bling #1609 [Tobias Luekte]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-05 07:19:20 +00:00
Jeremy Kemper
c1efa54195 Include all tables in mysql, sqlite, and postgresql drop sql.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1695 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-05 05:07:49 +00:00
David Heinemeier Hansson
4180e57b70 Added callback hooks to association collections #1549 [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-04 08:43:57 +00:00
David Heinemeier Hansson
df95128e94 Fixed that has_and_belongs_to_many didn't respect single table inheritance types #1081 [Florian Weber]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1641 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:52:59 +00:00
David Heinemeier Hansson
d9d22c7596 Fixed that single-table inheritance sub-classes couldn't be used to limit the result set with eager loading #1215 [Chris McGrath]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1619 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-03 08:21:22 +00:00
David Heinemeier Hansson
f2a29ca43c Added support for ODBC connections to MS SQL Server so you can connect from a non-Windows machine #1569 [Mark Imbriaco/DeLynn Berry] Added support for limit/offset with the MS SQL Server driver so that pagination will now work #1569 [DeLynn Berry]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1583 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-07-01 17:20:04 +00:00
David Heinemeier Hansson
a2f26b971b Fixed that adding a record to a has_and_belongs_to collection would always save it -- now it only saves if its a new record #1203 [Alisdair McDiarmid]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-18 05:28:59 +00:00
Jeremy Kemper
1d9905a67f r1307@iwill: jeremy | 2005-06-13 19:05:00 -0700
Ticket 1312 - Malformed habtm finder sql
 r1308@iwill:  jeremy | 2005-06-13 19:58:48 -0700
 Add a habtm with an unquoted condition to Project.
 r1309@iwill:  jeremy | 2005-06-13 19:59:46 -0700
 Space out habtm finder conditions.
 r1310@iwill:  jeremy | 2005-06-13 20:00:16 -0700
 Test habtm.find with quoted and unquoted conditions.
 r1311@iwill:  jeremy | 2005-06-13 20:00:25 -0700
 Update changelog


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1414 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 21:51:43 +00:00
Jamis Buck
37a370d8d4 Be sure to use the @finder_sql in the has_many association's #find method, even if explicit conditions have not been given.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-13 12:03:33 +00:00
Jeremy Kemper
1fde44bfee r1278@iwill: jeremy | 2005-06-12 05:11:48 -0700
Branch for PostgreSQL schema.  Ticket #827.
 r1281@iwill:  jeremy | 2005-06-12 19:06:43 -0700
 remove search_path from PostgreSQL db definition
 r1282@iwill:  jeremy | 2005-06-12 19:07:50 -0700
 Rakefile support for database-specific tests.
 r1283@iwill:  jeremy | 2005-06-12 19:10:18 -0700
 Add schema_search_path attribute to PostgreSQL adapter.  Replace table_structure with column_definitions which finds the given table_name in the schema search path.
 r1284@iwill:  jeremy | 2005-06-12 19:12:10 -0700
 Unit test PostgreSQL schema search path.
 r1285@iwill:  jeremy | 2005-06-12 19:12:20 -0700
 Changelog entry.
 r1286@iwill:  jeremy | 2005-06-12 20:08:20 -0700
 Don't try to quote schema names.  Include a reference to the PostgreSQL schema docs.
 r1287@iwill:  jeremy | 2005-06-12 20:16:07 -0700
 SchemasTest -> SchemaTest


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 22:05:30 +00:00
Jeremy Kemper
d0bd3b5af4 Return PostgreSQL columns in the order they are declared #1374 (perlguy@gmail.com). Unit test column order, adapter housekeeping, simplify users of columns_hash.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-12 06:56:51 +00:00
Jeremy Kemper
cd033c63c2 Preserve extendedWarranty case in PostgreSQL computers table.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1401 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-11 20:26:07 +00:00
Jamis Buck
2c0fa32088 Do not use instantiated fixtures (in general) in tests. Also, support the 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
2005-06-10 14:58:02 +00:00
Jamis Buck
7f9ffb2ebf Eager loading of dependent has_one associations won't delete the association #1212. Also, starting to refactor the tests to make them speedier, with optional support for transactional fixtures.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-06-10 13:54:58 +00:00
David Heinemeier Hansson
190e04645b Fixed that :delete_sql in has_and_belongs_to_many associations couldn't access record properties #1299 [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 17:07:56 +00:00
David Heinemeier Hansson
bd79a4eb3b Fixed that clone would break when an aggregate had the same name as one of its attributes #1307 [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-05-19 16:39:50 +00:00
David Heinemeier Hansson
2bf223051e Added compatibility with camelCase column names for dynamic finders #533 [Dee.Zsombor]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1263 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-30 15:49:28 +00:00
David Heinemeier Hansson
7881e4dae0 Fixed OCI fixtures [Ryan Carver]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 10:58:22 +00:00
David Heinemeier Hansson
cdf88b7b04 Fixed stray comma when using eager loading and ordering together from has_many associations #1143
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-19 05:24:50 +00:00
David Heinemeier Hansson
03097d3a60 Fixed that fixtures were being deleted in the same order as inserts causing FK errors #890 [andrew.john.peters@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 07:52:58 +00:00
David Heinemeier Hansson
1a6954af01 Changed habtm eager loading to also use joins
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1201 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 05:55:20 +00:00
David Heinemeier Hansson
76690111d5 Fixes for postgresql testing #1129, #1130, #1131
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-18 05:03:56 +00:00
David Heinemeier Hansson
44073321a8 SqlServer fixtures - CategoriesPosts
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 13:57:25 +00:00
David Heinemeier Hansson
339f4956b3 Added acts_as_nested_set #1000 [wschenk]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-17 09:52:12 +00:00
David Heinemeier Hansson
75b8ac80d9 Dont initialize the association proxy for nil records
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1165 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-14 07:49:13 +00:00
David Heinemeier Hansson
2daf2c846d Fixed db schema
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-10 17:29:14 +00:00
David Heinemeier Hansson
057cf4918b Added support for has_and_belongs_to_many associations in eager loading #1064 [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-10 17:24:56 +00:00
David Heinemeier Hansson
fdd268138a Made eager loading work with inheritance hierarchies #1065 [Ryan Carver]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-10 15:49:49 +00:00
David Heinemeier Hansson
7ad57c4f02 Added quoting of column names for fixtures #997 [jcfischer@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-07 06:54:25 +00:00
David Heinemeier Hansson
7b37c779d8 Fixed counter_sql when no records exist in database for PostgreSQL (would give error, not 0) #1039 [Caleb Tennis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1104 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-07 06:29:31 +00:00
David Heinemeier Hansson
bd9a81ca2d Moved to new server
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1102 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-07 06:20:54 +00:00
David Heinemeier Hansson
f8783abf0c Made eager loading work even more
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1083 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 17:50:11 +00:00
David Heinemeier Hansson
abc895b828 Added new Base.find API and deprecated find_all, find_first. Added preliminary support for eager loading of associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1077 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-03 10:52:05 +00:00
David Heinemeier Hansson
52e5d748bc Made sure all MySQL tables are created as InnoDB
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-04-02 07:46:41 +00:00
David Heinemeier Hansson
f30b7a31bd Fixed the MS SQL adapter to work with the new limit/offset approach and with 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
2005-03-23 00:56:13 +00:00
David Heinemeier Hansson
ce9a9433b3 changes the CREATE TABLE script for the "binaries" table to use the "image" datatype. The script was previously failing to create a table (on SQL Server 2000). #834 [adelle]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@926 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-20 13:55:40 +00:00
David Heinemeier Hansson
5e44eda787 Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@834 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-06 11:53:49 +00:00
David Heinemeier Hansson
02ba03509c Added better defaults for composed_of, so statements like composed_of :time_zone, :mapping => %w( time_zone time_zone ) can be written without the mapping part (it's now assumed)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-01 23:52:36 +00:00
David Heinemeier Hansson
eac7cf0b06 Added preliminary support for an agile database migration technique (currently only for MySQL)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@818 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-03-01 14:27:32 +00:00
David Heinemeier Hansson
10d458b0aa Added a OCI8-based Oracle adapter that has been verified to work with Oracle 8 and 9 #629 [Graham Jenkins]. Removed Maiks Oracle adapter until it can be merged with the OCI one.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-23 13:34:57 +00:00
David Heinemeier Hansson
101968f367 Added automatic dropping/creating of test tables for running the unit tests on all databases #587 [adelle@bullet.net.au]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-20 21:21:41 +00:00
David Heinemeier Hansson
4ce69d79b7 Fix test case for MySQL #598
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@619 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-02-15 02:06:52 +00:00
David Heinemeier Hansson
336c2cbb8f Added an Oracle adapter that works with the Oracle bindings by Yoshida (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
2005-02-07 14:06:00 +00:00
David Heinemeier Hansson
10220d356d Fixed dependency reloading by switching to a remove_const approach where all Active Records, Active Record Observers, and Action Controllers are reloading by undefining their classes. This enables you to remove methods in all three types and see the change reflected immediately and it fixes #539. This also means that only those three types of classes will benefit from the const_missing and reloading approach. If you want other classes (like some in lib/) to reload, you must use require_dependency to do it.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-25 18:45:06 +00:00
David Heinemeier Hansson
823554eafe Added support for associating unsaved objects #402 [Tim Bates]
Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates]
Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates]
Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates]
Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-15 17:45:16 +00:00
David Heinemeier Hansson
0f4cba7b86 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@388 5ecf4fe2-1ee6-0310-87b1-e25e094e27de 2005-01-11 00:53:04 +00:00
David Heinemeier Hansson
79365a0184 Fixed that foreign keys named the same as the association would cause stack overflow #437 [Eric Anderson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@382 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-11 00:24:19 +00:00
David Heinemeier Hansson
d9e900cd9d Fixed the last details to please DB2
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@324 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-03 23:00:44 +00:00
David Heinemeier Hansson
612bb73fec Fixed a YAML fixture on time coming out as an integer #415 [Dan Peterson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@322 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 23:31:13 +00:00
David Heinemeier Hansson
959f362ac4 Added find_all style to the new dynamic finders
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@308 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-02 13:51:00 +00:00
David Heinemeier Hansson
86df396491 Added the latest two tables to the DB2 schemas
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:32:09 +00:00
David Heinemeier Hansson
daf3e92a31 Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 19:22:16 +00:00
David Heinemeier Hansson
3e0077f54d Fixed a bug in the Ruby/MySQL that caused binary content to be escaped badly and come back mangled #405 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2005-01-01 18:34:39 +00:00
David Heinemeier Hansson
fbf9281f0e Added automated optimistic locking if the field lock_version is present #384 [Michael Koziarski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@295 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-31 19:38:04 +00:00
David Heinemeier Hansson
edbeec91ba Fixed mixin test and fixtures to work with postgresql #353 [Scott Baron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@253 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-22 14:14:45 +00:00
David Heinemeier Hansson
69cb942d9b Changed the interface on AbstractAdapter to require that adapters return the number of affected rows on delete and update operations. Added that Base.update_all and Base.delete_all return an integer of the number of affected rows #341
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@228 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 16:21:55 +00:00
David Heinemeier Hansson
356f16006b Added higher_item and lower_item as public methods for acts_as_list #342 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 13:01:47 +00:00
David Heinemeier Hansson
a2130c22d7 Set a high default salary within the validation range
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@217 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:44:59 +00:00
David Heinemeier Hansson
87b0d72fe6 Added Developer#salary for the type tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@216 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:41:34 +00:00
David Heinemeier Hansson
7b5ed66122 Added respondence to *_before_type_cast for all attributes to return their string-state before they were type casted by the column type. Added use of *_before_type_cast for all input and text fields.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-19 11:25:55 +00:00
David Heinemeier Hansson
c5d6aa2b18 Added option for turning off the automated timestamps
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 15:21:16 +00:00
David Heinemeier Hansson
87297f1c4b Added assumption that a Symbol-based scope should end in _id unless it does so already and that you can pass vanilla string-based scopes as a parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@183 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 13:42:21 +00:00
David Heinemeier Hansson
4d6bfc7a36 Added assumption that a Symbol-based scope should end in _id unless it does so already and that you can pass vanilla string-based scopes as a parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 13:37:06 +00:00
David Heinemeier Hansson
1f916a119c Added that Active Records will automatically record creation and/or update timestamps of database objects if fields of the names created_at/created_on or updated_at/updated_on are present. [Tobias Luetke] Added acts_as_tree that can decorates an existing class with a many to many relationship with itself. Added acts_as_list that can decorates an existing class with methods like move_higher/lower, move_to_top/bottom.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 02:49:18 +00:00
David Heinemeier Hansson
1579f3b45d Added Base.validates_format_of that Validates whether the value of the specified attribute is of the correct form by matching it against the regular expression provided. [Marcel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-16 01:32:35 +00:00
David Heinemeier Hansson
95314be65b Added tree mixin and unit tests for all the mixins
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-15 00:46:26 +00:00
David Heinemeier Hansson
605bc77533 Added a better exception for when a type column is used in a table without the intention of triggering single-table inheritance. Added that single-table inheritance will only kick in if the inheritance_column (by default "type") is present. Otherwise, inheritance wont have any magic side effects
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-14 12:32:29 +00:00
David Heinemeier Hansson
5c50df27cf Attempted to capture #286 in a unit test, but couldnt get it to fail
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@132 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-12 18:12:57 +00:00
David Heinemeier Hansson
fc817eff44 Added validation macros to make the stackable just like the lifecycle callbacks
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@94 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-09 12:50:18 +00:00
David Heinemeier Hansson
ea759cb761 Added counter_sql option for has_many associations [bitsweat]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@68 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-07 12:25:01 +00:00
David Heinemeier Hansson
0daa29ece2 Added proper handling of time fields that are turned into Time objects with the dummy date of 2000/1/1 [HariSeldon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@40 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-12-01 13:18:51 +00:00
David Heinemeier Hansson
db045dbbf6 Initial
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2004-11-24 01:04:44 +00:00