Commit Graph

12152 Commits

Author SHA1 Message Date
Jeremy Kemper
4691cc43ee Fix ruby version test 2009-12-28 11:40:23 -08:00
Jeremy Kemper
632df063a3 Merge commit 'josevalim/validations' 2009-12-28 11:13:35 -08:00
Pratik Naik
91e28aae86 Add Model.having and Relation#having 2009-12-29 00:07:46 +05:30
Eloy Duran
9c771a9608 Make sure to not add autosave callbacks multiple times. [#3575 state:resolved]
This makes sure that, in a HABTM association, only one join record is craeted.
2009-12-28 16:56:31 +01:00
Murray Steele
ff508640e2 Make polymorphic_inverse_of in Reflection throw an InverseOfAssociationNotFoundError if the supplied class doesn't have the appropriate association. [#3520 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-12-28 15:12:17 +01:00
Murray Steele
6a74ee7f4d Provide a slightly more robust we_can_set_the_inverse_on_this? method for polymorphic belongs_to associations. [#3520 state:resolved]
Also add a new test for polymorphic belongs_to that test direct accessor assignment, not just .replace assignment.

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-12-28 15:12:15 +01:00
George Ogata
81ca0cf2b0 Add inverse polymorphic association support. [#3520 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-12-28 15:12:13 +01:00
Murray Steele
6c8c85bc1e Add more tests for the various ways we can assign objects to associations. [#3513 state:resolved]
Get rid of a duplicate set_inverse_instance call if you use new_record(true) (e.g. you want to replace the existing instance).

Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-12-28 15:12:11 +01:00
George Ogata
fc85c66527 Set inverse for #replace on a has_one association. [#3513 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
2009-12-28 15:12:07 +01:00
Pratik Naik
e8ca22d129 Move Relation calculation methods to a separate module 2009-12-28 19:12:15 +05:30
Pratik Naik
8f5d9eb0e2 Add Relation#count 2009-12-28 18:38:28 +05:30
Pratik Naik
aefa975fdd Remove the todo note for arel#lock 2009-12-28 16:20:40 +05:30
Pratik Naik
02207dc02c Add Model.readonly and association_collection#readonly finder method 2009-12-28 16:17:46 +05:30
Mikel Lindsaar
b354496bda Adding default 8bit encoding if the body has non usascii in it 2009-12-28 21:41:16 +11:00
José Valim
616ebb8f6a Remove unused code paths and require mail only when it's needed. 2009-12-28 11:21:36 +01:00
Pratik Naik
5156507e13 Remove locking related unused code 2009-12-28 14:33:56 +05:30
Pratik Naik
b95cc72429 Raise ArgumentError when trying to merge relations of different classes 2009-12-28 14:24:52 +05:30
Pratik Naik
92c982d973 Relation#readonly(false) should toggle the readonly flag 2009-12-28 14:20:54 +05:30
Pratik Naik
9f4e98330b Remove unused construct_finder_sql 2009-12-28 12:57:35 +05:30
Pratik Naik
d6b0a7d67c Fix a typo in CHANGELOG 2009-12-28 12:44:43 +05:30
Pratik Naik
a3c1db4e44 Add Model.lock and relation#lock now that arel has locking 2009-12-28 12:42:06 +05:30
Yehuda Katz
9abbe9f0b3 Merge branch 'master' of github.com:rails/rails 2009-12-27 22:27:33 -08:00
David Heinemeier Hansson
1c47d04ea5 Added Object#presence that returns the object if it's #present? otherwise returns nil [DHH/Colin Kelley] 2009-12-27 17:54:43 -08:00
David Heinemeier Hansson
a642edbef3 Added default .gitignore (this is just recognizing Git market share, don't throw a hissy if you use another SCM) [DHH] 2009-12-27 17:48:11 -08:00
Mikel Lindsaar
c039bcdb1c Moved sort_parts into Mail, updated mail requirement to 1.4.2 2009-12-28 12:25:14 +11:00
Yehuda Katz
99f7e0ff27 Update rack submodule 2009-12-27 16:20:27 -08:00
Yehuda Katz
f095e6f59d Fixes some problems with getting a new app working 2009-12-27 16:00:34 -08:00
Jeremy Kemper
19c48281a7 String#exclude? core extension: inverse of #include? 2009-12-27 15:49:29 -08:00
Jeremy Kemper
7c4fb93ac3 Ruby 1.9: string is not enumerable, so #exclude? is not available 2009-12-27 15:38:00 -08:00
Jeremy Kemper
3a79117c77 Typo 2009-12-27 15:27:18 -08:00
David Heinemeier Hansson
ebe3c8f2e4 Merge branch 'master' of github.com:rails/rails 2009-12-27 15:23:38 -08:00
David Heinemeier Hansson
438a8c3ec7 Require the enumberable extension from active support because we use #exclude? 2009-12-27 15:23:30 -08:00
José Valim
a176263ebc Fix generators tests.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-12-27 15:19:16 -08:00
Jeremy Kemper
292363c75f Use i18n 2009-12-27 15:17:44 -08:00
David Heinemeier Hansson
5012a1558d Merge branch 'master' of github.com:rails/rails 2009-12-27 14:44:21 -08:00
David Heinemeier Hansson
1cd949006a Fix the i18n dependency problem 2009-12-27 14:43:06 -08:00
Yehuda Katz
12e43494a7 Merge remote branch 'jose/perf' 2009-12-27 14:36:59 -08:00
Pratik Naik
1c26ba486c Add Model.from and association_collection#from finder methods 2009-12-28 03:59:44 +05:30
Pratik Naik
6a776dcc9d Use relation.from when constructing a relation 2009-12-28 03:59:44 +05:30
David Heinemeier Hansson
9521fcbcc2 Merge branch 'master' of github.com:rails/rails 2009-12-27 14:14:54 -08:00
David Heinemeier Hansson
95762cbbb3 Added shorthand for match 'products/overview' that expands to match 'products/overview', :to => 'products#overview', :as => 'products_overview' 2009-12-27 14:13:03 -08:00
Pratik Naik
a0ff5f82c3 Dont delegate relation#find to to_a 2009-12-28 03:22:33 +05:30
Pratik Naik
e9e20ab601 Use arel#from instead of the current hack 2009-12-28 03:19:31 +05:30
Pratik Naik
630dc50730 Fix relation tests for postgres 2009-12-28 02:50:04 +05:30
Pratik Naik
51a1d5a670 Handle preloads and eager loads when merging relations 2009-12-28 01:33:20 +05:30
Pratik Naik
a8b10a2a8d Add relation#merge to merge two relations 2009-12-28 01:08:34 +05:30
Pratik Naik
08312e9958 Return a new relation when blank is supplied to relation.joins 2009-12-27 23:29:41 +05:30
Pratik Naik
5565bab994 Rewrite AssociationCollection#find using relations 2009-12-27 22:32:20 +05:30
Pratik Naik
bbdeaae2ca Add relation.destroy_all 2009-12-27 21:15:12 +05:30
Pratik Naik
5cd8818258 Make Model.destroy_all use new finders 2009-12-27 19:22:18 +05:30