Commit Graph

1067 Commits

Author SHA1 Message Date
Jeremy Kemper
43b81d01d0 move assets and models
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00
Rick Olson
49794485b6 Ensure that modifying has_and_belongs_to_many actions clear the query cache. Closes #10840 [john.andrews]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 01:55:11 +00:00
Michael Koziarski
61e550ade9 Don't ignore :precision and :scale when adding columns on postgresql. Closes #6868 [w.piekutowski]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-16 03:54:15 +00:00
Rick Olson
ebfd03b938 Fix issue where Table#references doesn't pass a :null option to a *_type attribute for polymorphic associations. Closes #10753 [railsjitsu]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8627 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-11 19:54:19 +00:00
Jeremy Kemper
8f7fa55e8d Fixtures: removed support for the ancient pre-YAML file format. Closes #10736.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8594 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-08 03:54:40 +00:00
Jeremy Kemper
ebe3a0d532 More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 14:58:28 +00:00
Jeremy Kemper
139b92495f * Continue evolution toward ActiveSupport::TestCase and friends. #10679 [Josh Peek]
* TestCase: introduce declared setup and teardown callbacks. Pass a list of methods and an optional block to call before setup or after teardown. Setup callbacks are run in the order declared; teardown callbacks are run in reverse.  [Jeremy Kemper]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-05 13:34:15 +00:00
Jeremy Kemper
c36f8111a6 pdate_all ignores scoped :order and :limit, so post.comments.update_all doesn't try to include the comment order in the update statement. Closes #10686.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8554 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 03:19:50 +00:00
Jeremy Kemper
25db1fc201 Ruby 1.9 compat: test multibyte chars proxy for 1.8 only
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8553 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-04 03:19:20 +00:00
David Heinemeier Hansson
424c330634 Added by parameter to increment, decrement, and their bang varieties so you can do player1.increment!(:points, 5) (closes #10542) [Sam]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8534 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-03 00:30:22 +00:00
Jeremy Kemper
20d29b3797 Ruby 1.9 compat: introduce ActiveSupport::FrozenObjectError normalize TypeError vs RuntimeError handling. Closes #10645 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-29 19:43:07 +00:00
Rick Olson
0e3a54a3b9 Don't unnecessarily load has_many associations in after_update callbacks. Closes #6822 [stopdropandrew, canadaduane]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 18:01:22 +00:00
Jeremy Kemper
7555073803 Ruby 1.9 compat: introduce instance_variable_names. Closes #10630 [Frederick Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8499 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-28 05:42:12 +00:00
Jeremy Kemper
f013e047ef Ruby 1.9 compat: don't modify iterator target within block
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8487 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:51 +00:00
Jeremy Kemper
240b4c527e Ruby 1.9 compat: attribute methods
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8486 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-27 11:16:39 +00:00
Jeremy Kemper
8b5f4e474f Ruby 1.9 compat: fix warnings, shadowed block vars, and unitialized instance vars
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8481 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-22 11:26:03 +00:00
Jeremy Kemper
f6379bfe15 Eager belongs_to :include infers the foreign key from the association name rather than the class name. Closes #10517.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8456 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:49:01 +00:00
Jeremy Kemper
15b38efde8 Benchmark logs for any level below or equal to the one specified, rather than just equal. Closes #10580 [Dan Manges]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8455 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-21 01:48:20 +00:00
Jeremy Kemper
b72763a96f SQLite: fix rename_ and remove_column for columns with unique indexes. Closes #10576.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-20 22:28:12 +00:00
Rick Olson
5dc831fd9a add passing test for Test::Unit subclasses running #setup properly [brynary]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 22:49:27 +00:00
Jeremy Kemper
0b84af9599 Revert [8392]. Closes #10568, reopens #10379.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-19 21:16:27 +00:00
Rick Olson
ce102e3af9 Ensure optimistic locking handles nil #lock_version values properly. Closes #10510 [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8395 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:45:30 +00:00
Rick Olson
abd7cf343c Make the Fixtures Test::Unit enhancements more supporting for double-loaded test cases. Closes #10379 [brynary]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-15 01:23:05 +00:00
Rick Olson
d98728e091 Fix that validates_acceptance_of still works for non-existent tables (useful for bootstrapping new databases). Closes #10474 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8377 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-12 23:55:14 +00:00
Rick Olson
66e97c34c1 Ensure that the :uniq option for has_many :through associations retains the order. #10463 [remvee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 20:08:30 +00:00
Jeremy Kemper
f67add4283 Base.exists? doesn't rescue exceptions to avoid hiding SQL errors. Closes #10458.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8375 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-11 01:53:54 +00:00
Jeremy Kemper
b1ce7e4d4a Ruby 1.9 compat: File.exists\? -> File.exist\? en masse. References #1689 [Pratik Naik]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 05:54:46 +00:00
Jeremy Kemper
d0f192cd75 Remove empty ar_joins_test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8353 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:37:11 +00:00
Jeremy Kemper
220a64e9b6 post.comments.reload returns the association rather than the result of load_target. Closes #10438 [Fred Cheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-10 01:07:04 +00:00
Geoff Buesing
2766f7629f Anchor DateTimeTest to fixed DateTime instead of a variable value based on Time.now#advance#to_datetime. Works around issue on 64-bit platforms with Ruby's Time#to_datetime respecting fractional seconds, and database adapters not respecting them for DateTimes, throwing off before-and-after-save equality test. References #10080, #10073
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8326 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-07 03:00:50 +00:00
David Heinemeier Hansson
e16ecaf84c Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped (closes #10385) [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-06 00:01:11 +00:00
Jeremy Kemper
52fe604da3 Fix eager association test. Closes #10381 [alexey]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 22:06:26 +00:00
David Heinemeier Hansson
6fd1a4d502 Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8309 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 21:37:51 +00:00
David Heinemeier Hansson
2af36bbbd4 Fix typos (closes #10378)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8301 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 18:54:41 +00:00
David Heinemeier Hansson
37b1d33ba3 Try again
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:50:18 +00:00
Jeremy Kemper
e7dab3b166 MySQL: we can't distinguish a fake 0 default in 4.x
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:46:28 +00:00
David Heinemeier Hansson
a5fded3e88 Fix that options[:from] table names should never be quoted [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8270 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-05 02:30:30 +00:00
David Heinemeier Hansson
e6f54290af Added ActiveRecord::Base#becomes to turn a record into one of another class (mostly relevant for STIs) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8259 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-03 02:01:21 +00:00
David Heinemeier Hansson
c4cb2dd014 Fixed that to_xml should not automatically pass :procs to associations included with :include (closes #10162) [chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8258 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-12-03 01:47:21 +00:00
Michael Koziarski
e302759451 Make reset return nil when using a dangling belongs_to association. Current behaviour is to return false which can be confusing. Closes #10293 [fcheung]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8236 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-29 02:19:10 +00:00
Jeremy Kemper
3a3e7efee9 attr_protected and _accessible use sets of strings instead of arrays of symbols internally. Closes #10300.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8231 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-28 20:13:17 +00:00
Jeremy Kemper
a33007d31a attr_readonly uses a set of strings instead of an array of symbols internally. References #10300.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-28 20:12:49 +00:00
Jeremy Kemper
c7e3969189 Foxy fixtures: support single-table inheritance. Closes #10234.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8219 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-26 22:46:11 +00:00
Jeremy Kemper
8b3f83105c Foxy fixtures: allow mixed usage to make migration easier and more attractive. Closes #10004.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8218 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-26 22:45:43 +00:00
David Heinemeier Hansson
18c663eb12 Allow validates_acceptance_of to use a real attribute instead of only virtual (so you can record that the acceptance occured) (closes #7457) [ambethia]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8208 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-25 22:34:46 +00:00
David Heinemeier Hansson
f4b5ca1ff0 Fixed that create table with :id => false and fixtures don't play nice together (closes #10154) [jbarnette]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8205 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-25 22:08:38 +00:00
Geoff Buesing
becdb49186 Honor Ruby's default calendar reform setting when creating DateTime objects via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-24 04:59:21 +00:00
Jeremy Kemper
9afbf875eb Add example.log for binary escaping test. References #10176.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8186 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-22 01:30:22 +00:00
Jeremy Kemper
dd27c4e5fb PostgreSQL: correct binary escaping. References #8049, closes #10176 [jbasdf, tmacedo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-22 01:29:19 +00:00
Jeremy Kemper
440f2890af Dynamic finders on association collections respect association :limit. Closes #10227 [Jack Danger Canty]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-21 07:32:44 +00:00
Michael Koziarski
7d459203ee Make Dynamic Finders on Association Collections Respect Association :order [patrick.t.joyce, technoweenie]. Closes #10211
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-21 01:51:57 +00:00
Jeremy Kemper
8ed83b9b1e validates_inclusion_of and validates_exclusion_of allow formatted :message strings. Closes #8132 [devrieda, Mike Naberezny]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8172 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-20 22:01:04 +00:00
Michael Koziarski
c95f066bf5 Add 'foxy' support for fixtures of polymorphic associations. Closes #10183 [jbarnette, David Lowenfels]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8170 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-20 21:53:22 +00:00
Jeremy Kemper
473202df83 attr_readonly behaves well with optimistic locking. Closes #10188.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-16 20:31:24 +00:00
Jeremy Kemper
990a3f3a83 Use rexml for some tests rather than string include? checks to account for unordered attributes. Closes #10164 [Catfish]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-14 18:59:05 +00:00
Jeremy Kemper
ea256eaa7f Base#to_xml supports the nil="true" attribute like Hash#to_xml. Closes #8268.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8138 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-14 10:33:25 +00:00
Rick Olson
3104291322 Fix HasManyThrough Association so it uses :conditions on the HasMany Association. Closes #9729 [danger]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8128 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-11 01:03:43 +00:00
Michael Koziarski
79823e0b2f Ensure that column names are quoted. Closes #10134 [wesley.moxam]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8126 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-10 21:33:13 +00:00
David Heinemeier Hansson
b318134c99 Kill the whiny_protected_attributes setting and kill the exception raised. Instead, just log the mass-assignment misalignment as a debug warning (closes #9966)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8120 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-09 19:57:24 +00:00
David Heinemeier Hansson
37adea6ff1 Address shortcomings of changeset [8054] [protocool]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8109 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-11-07 15:07:39 +00:00
Michael Koziarski
8f74527282 Escape table names during calculation queries. [wesley.moxam, Koz] Closes #4593
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8061 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-31 05:58:09 +00:00
Michael Koziarski
3c9cd19786 Make fixtures work with the new test subclasses. [tarmo, Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-31 05:43:52 +00:00
Jeremy Kemper
bef071dd0b Introduce finder :joins with associations. Same :include syntax but with inner rather than outer joins. Closes #10012.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-29 21:39:52 +00:00
Rick Olson
c708346688 Change JSON to encode %w(< > &) as 4 digit hex codes to be in compliance with the JSON spec. Closes #9975 [josh, chuyeow, tpope]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8050 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-29 00:18:43 +00:00
Michael Koziarski
df0765d8dc Make sure that << works on has_many associations on unsaved records. Closes #9989 [hasmanyjosh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8049 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-28 03:39:18 +00:00
Jeremy Kemper
88f951a519 Allow association redefinition in subclasses. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8046 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-27 20:31:09 +00:00
Jeremy Kemper
4b639904d7 Fix has_many :through delete with custom foreign keys. Closes #6466.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8043 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-27 18:51:32 +00:00
Jeremy Kemper
49eafd8c36 Foxy fixtures. Adapter#disable_referential_integrity. Closes #9981.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 05:56:46 +00:00
Marcel Molina
bf658a906b Allow find on a has_many association defined with :finder_sql to accept id arguments as strings like regular find does. Closes #9916 [krishna]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8030 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-26 03:42:28 +00:00
Michael Koziarski
2d208eb3a0 Make sure that the Schema Dumper supports non-standard primary keys with MySQL. Closes #9971 [RubyRedRick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-25 06:42:05 +00:00
Marcel Molina
c8b6b4821f Limited eager loading no longer ignores scoped :order. Closes #9561 [danger, josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 18:34:01 +00:00
Jeremy Kemper
7b42a1d0ac Assigning an instance of a foreign class to a composed_of aggregate calls an optional conversion block. Refactor and simplify composed_of implementation. Closes #6322.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8003 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 17:39:35 +00:00
Jeremy Kemper
c220e558be Assigning nil to a composed_of aggregate also sets its immediate value to nil. Closes #9843.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8002 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 17:29:42 +00:00
Jeremy Kemper
28729a4829 validates_uniqueness_of behaves well with abstract superclasses. References #3833, closes #9886.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-23 06:18:42 +00:00
Jeremy Kemper
902533e6f0 Reinstate test_change_column_nullability for all adapters. Closes #9945 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7996 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-22 23:52:04 +00:00
Jeremy Kemper
e829e12e16 test_select_rows shouldn't depend on implicit result ordering. Closes #9898 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-22 23:50:12 +00:00
Rick Olson
7042163d76 Ensure that mysql quotes table names with database names correctly. Closes #9911 [crayz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7980 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-20 21:17:31 +00:00
Michael Koziarski
17ac677a2d typo in test name
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7977 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:51:44 +00:00
Michael Koziarski
3facc8578b Few more tests for Sexy Migrations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:25:23 +00:00
Michael Koziarski
6ddde027c4 Add t.belongs_to and t.references to sexy migrations [arthurgeek]
Test harness for Sexy Migrations. [Koz]
Closes #9775


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7973 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 02:09:06 +00:00
Michael Koziarski
210f7e29e2 Move all Schema creation into schema.rb for Mysql. Closes #9899 [mikong, lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-19 01:52:50 +00:00
Jeremy Kemper
2fac5d1a8b SQL Server: test for affected row count. References #9558 [lawrence, ryepup]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7968 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-18 23:47:59 +00:00
Michael Koziarski
2833706699 Read in binary mode to make sure windows support keeps working. [lawrence] Closes #9912
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7959 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 22:50:34 +00:00
Michael Koziarski
8ed1e885b7 Use a smaller binary fixture so we don't overflow column size limitations in some commercial / legacy databases. Closes #7987 [roderickvd, lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-17 21:35:46 +00:00
Jeremy Kemper
f575757ca4 Qualified column names work in hash conditions, like :conditions => { 'comments.created_at' => ... }. Closes #9733.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7943 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 08:08:08 +00:00
Jeremy Kemper
cfbd790ad3 Fix regression where the association would not construct new finder SQL on save causing bogus queries for "WHERE owner_id = NULL" even after owner was saved. Closes #8713.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7942 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 07:24:23 +00:00
Jeremy Kemper
a72c1ec43e Refactor association create and build so before & after callbacks behave consistently. Closes #8854.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:07:58 +00:00
Jeremy Kemper
9b6207c3d0 Quote table names. Defaults to column quoting. Closes #4593.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:06:33 +00:00
Jeremy Kemper
197c888576 Moving SQL Server tests to the extracted adapter. References #9884.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7930 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-16 05:05:22 +00:00
Jeremy Kemper
671228942d Alias association #build to #new so it behaves predictably. Closes #8787.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 08:09:04 +00:00
Jeremy Kemper
660a696a3f Test that change_column quotes column names. Closes #9537 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 07:33:53 +00:00
Jeremy Kemper
e81f1acc33 Uncomment test for join model method_missing. Closes #8707 [Giles Bowkett, Josh Peek]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7897 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 04:14:10 +00:00
Jeremy Kemper
619f2897f5 Update test/all.sh
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 03:46:15 +00:00
Jeremy Kemper
6cc7095320 Update IGNORED_SQL for SQL Server. Closes #9638 [lawrence]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7895 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-15 03:32:00 +00:00
Rick Olson
f56dd107cd Observers can observe model names as symbols properly now. Closes #9869 [queso]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7872 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-14 05:20:24 +00:00
Tobias Lütke
0ad5365bf4 find_and_(initialize|create)_by methods can now properly initialize protected attributes
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7826 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 19:11:50 +00:00
Michael Koziarski
1c881ca5bf Ensure that 'autosaving' works when associations aren't loaded [Bryan Helmkamp] References #8713
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-10 06:45:13 +00:00
Michael Koziarski
3122d321fd Make sure AR::Base#clone handles attr changes made in after_initialize hooks. Closes #7191 [weyus]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 06:21:38 +00:00
Jeremy Kemper
4eaa8ba5be PostgreSQL: support multiline default values. Closes #7533.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7801 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 06:17:53 +00:00
Jeremy Kemper
85c86f0999 MySQL: fix change_column on not-null columns that don't accept dfeault values of ''. Closes #6663.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7790 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 03:28:28 +00:00
Jeremy Kemper
210ecaecc3 validates_uniqueness_of behaves well with single-table inheritance. Closes #3833.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7787 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-08 01:44:55 +00:00
Jeremy Kemper
84a14f2620 Raise ProtectedAttributeAssignmentError in development and test environments when mass-assigning to an attr_protected attribute. Closes #9699.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 19:43:19 +00:00
Michael Koziarski
cd64471bdb Fix calling .clear on a has_many :dependent=>:delete_all association. [tarmo] Closes #6904
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 05:05:12 +00:00
Michael Koziarski
5a276643d1 Allow change_column to set NOT NULL in the PostgreSQL adaptor. Closes #3904 [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-07 04:52:09 +00:00
Michael Koziarski
8ef4bc6c75 Missed the add
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 01:03:19 +00:00
Michael Koziarski
638505b90f Send the correct INSERT statement when dealing with objects with only primary keys. Closes #9523 [tarmo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:49:58 +00:00
Michael Koziarski
4db718e2bb Only cache attributes which need it for performance reasons. Closes #9767 [skaes]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7752 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:48:43 +00:00
Jeremy Kemper
b96c298f47 Test for each JSON fragment to workaround assumed hash ordering.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7751 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:40:28 +00:00
Jeremy Kemper
55640fb939 Simplify some JSON tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7750 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:33:51 +00:00
Rick Olson
5b2e8b1eb1 Fix that ActiveRecord would create attribute methods and override custom attribute getters if the method is also defined in Kernel.methods. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7749 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-06 00:25:07 +00:00
Rick Olson
24c2457a26 Don't call attr_readonly on polymorphic belongs_to associations, in case it matches the name of some other non-ActiveRecord class/module. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7748 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-05 19:27:33 +00:00
Jeremy Kemper
b1968708e1 Hash#to_json takes :only or :except options to specific or omit certain hash keys. Enumerable#to_json passes through its options to each element. Closes #9751.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7736 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-04 03:28:42 +00:00
Jeremy Kemper
0ee1cb2cd3 Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-10-02 05:32:14 +00:00
David Heinemeier Hansson
7275d2749c Fixed JSON encoding to use quoted keys according to the JSON standard (closes #8762) [choonkat/chuyeow]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7697 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 20:57:50 +00:00
Rick Olson
66d05f5e2c Add attr_readonly to specify columns that are skipped during a normal ActiveRecord #save operation. Closes #6896 [dcmanges]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7693 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 07:09:44 +00:00
Rick Olson
30a652ad41 Make size for has_many :through use counter cache if it exists. Closes #9734 [xaviershay]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7692 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-30 06:47:20 +00:00
Jeremy Kemper
26174b2881 Failing counter cache test. References #6896.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7675 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 23:55:50 +00:00
David Heinemeier Hansson
191a0484f0 Missing test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7674 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 21:11:14 +00:00
Jeremy Kemper
b095ce63f2 Fixtures test fixes and general cleanup. Closes #9682 [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7667 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:56:07 +00:00
David Heinemeier Hansson
e3b49c052b Fixed spelling errors (closes #9706) [tarmo/rmm5t]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:18:47 +00:00
David Heinemeier Hansson
078bd0515e Added fixture caching thatll speed up a normal fixture-powered test suite between 50% and 100% (closes #9682) [frederick.cheung@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7662 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-28 14:05:03 +00:00
Jeremy Kemper
4965b1b961 Correctly quote id list for limited eager loading. Closes #7482.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 23:51:03 +00:00
Michael Koziarski
1abe5a2ded Fix broken mysql test [frederick.cheung@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 22:33:51 +00:00
David Heinemeier Hansson
046a87a855 Fixed rename_column for SQLite when using symbols for the column names (closes #8616) [drodriguez]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 18:23:30 +00:00
David Heinemeier Hansson
00326bb0b4 Make date tests pass on 64-bit (closes #9121) [mutru]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7556 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-22 17:57:10 +00:00
David Heinemeier Hansson
e86d1cd621 Added ActiveRecord::Base#to_json/from_json (currently does not support :include like to_xml) [DHH]. Added ActiveRecord::Base#from_xml [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7519 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-20 23:22:30 +00:00
Michael Koziarski
7010ee361e Stop users from calling .create on a has_many / habtm association when the owner is a new_record?
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7511 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 10:26:56 +00:00
Tobias Lütke
4a1388adea Define dynamic finders as real methods after first usage. Close #9317
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-18 10:04:11 +00:00
Jeremy Kemper
81d619ea0d Associations macros accept extension blocks alongside modules. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 21:19:44 +00:00
Michael Koziarski
acbec3e565 Ensure that custom mutators aren't redefined by define_attribute_methods. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 09:29:02 +00:00
Jeremy Kemper
bfb906a905 Speed up and simplify query caching.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7498 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-17 06:15:58 +00:00
Jeremy Kemper
30fb7b8c8b connection.select_rows 'sql' returns an array (rows) of arrays (field values). Closes #2329.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7497 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-16 03:32:47 +00:00
Jeremy Kemper
b8657089f2 Eager loading respects explicit :joins. Closes #9496.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7494 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 23:50:12 +00:00
David Heinemeier Hansson
79202b37dc Fixed that altering join tables in migrations would fail w/ sqlite3 #7453 [TimoMihaljov/brandon]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7484 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-15 21:23:05 +00:00
Jeremy Kemper
498d8ff72e Fix association writer with :dependent => :nullify. Closes #7314.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7477 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-14 07:29:22 +00:00
Jeremy Kemper
f7c371dff8 OpenBase: update for new lib and latest Rails. Support migrations. Closes #8748.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7472 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-13 23:21:14 +00:00
Jeremy Kemper
54a6ed1482 minor speedups + forward-compat syntax
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-13 23:13:34 +00:00
Jeremy Kemper
b4ad9e0cb9 Kill lingering acts
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 06:47:27 +00:00
David Heinemeier Hansson
ea0975a20b Moved acts_as_tree into a plugin of the same name on the official Rails svn (closes #9514) [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7454 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 03:25:59 +00:00
David Heinemeier Hansson
11f4d28344 Moved acts_as_nested_set into a plugin of the same name on the official Rails svn (closed #9516) [josh]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7453 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-11 03:09:37 +00:00
Michael Koziarski
aa36ca1c5f Remove acts_as_list. Users are advised to install the new plugin. References #9415. [josh, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-10 04:41:09 +00:00
Jeremy Kemper
2894887925 Explicitly require active_record/query_cache before using it.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7419 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-08 04:31:26 +00:00
Michael Koziarski
0d696f09ac Fix assertion for the mysql default work around committed earlier.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7408 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 05:38:19 +00:00
Michael Koziarski
aa32f66ebb Add :allow_blank to validations. Like allow_nil, but for values which are +blank?+. [jnoon] Closes #7383
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7407 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-05 05:37:52 +00:00
Rick Olson
51977bc261 Fix bug where unserializing an attribute attempts to modify a frozen @attributes hash for a deleted record. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7406 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-04 17:32:48 +00:00
Michael Koziarski
3bbef581af Work around mysql limitations for defaults on text columns with not null. Closes #9324 [caio]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7405 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-04 02:44:10 +00:00
Michael Koziarski
6246fad19a Remove deprecated functionality from edge rails. Closes #9387 [lifofifo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-03 00:17:09 +00:00
Michael Koziarski
b18d9568a6 Ensure QueryCache doesn't try to dup numeric results (does not affect the major OS database). Closes #7661 [tomafro, nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7399 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-09-02 23:52:58 +00:00
Michael Koziarski
45ea329bcd Remove commented out test which refers to old code, old bugs and uses ObjectSpace in a nasty way. [nzkoz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-29 03:33:26 +00:00
Michael Koziarski
5840108b6e Pass the right binding when string is passed to :if with validations. [caspercg] Closes #9300
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7365 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-08-28 23:17:17 +00:00