Pratik Naik
aeafccf0ca
Merge commit 'mainstream/master'
2009-01-18 17:45:39 +00:00
lukeludwig
3ee4e00918
Cache columns for has_and_belongs_to_many associations
...
This avoids repeatedly calling SHOW COLUMNS when the association is queried
[#1738 state:committed]
2009-01-17 18:09:13 +13:00
Ben VandenBos
0e92f67073
Make belongs_to :dependent => :destroy destroy self before associated object [ #1079 state:resolved]
...
If foreign key constraints are in place then deleteing the associated object first will cause a foreign key violation
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2009-01-16 17:23:19 +00:00
Michael Lovitt
7a0e7c7270
Fixed broken after_save callback; was being called when before_create was canceled or before_update was canceled
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1735 state:committed]
2009-01-16 10:11:58 +13:00
Carlos Kozuszko
c891d685de
Fixing bug on ActiveRecord::Dirty#field_changed? for nullable numeric columns, NULL gets stored in database for blank (i.e. '') values. Only integer columns were considered.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#1692 state:committed]
2009-01-16 10:00:39 +13:00
Xavier Noria
ed847ad4e6
revised rdoc of class_of_active_record_descendant
2009-01-15 01:01:59 +01:00
Pratik Naik
deb597d63d
Merge commit 'mainstream/master'
2009-01-14 15:36:27 +00:00
Hongli Lai (Phusion)
9bcf01b23c
Fix PostgreSQL unit test failures that only occur when using the old 'postgres' driver.
...
[#1748 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-01-13 15:58:50 -08:00
Cody Fauser
b6a94fc1c6
Remove legacy reloadable? method from ActiveRecord::SessionStore [ #1745 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2009-01-13 13:45:10 -06:00
Chris Kampmeier
2a00f72aca
Docs: in typical usage, "descendant" is the noun and "descendent" is the adjective
2009-01-11 20:47:01 -08:00
Chris Kampmeier
efce9aa71b
A little copyediting of 73db43527d
2009-01-11 20:33:58 -08:00
Chris Kampmeier
73db43527d
Add better docs for ActiveRecord::Base#attribute_for_inspect
2009-01-11 20:28:15 -08:00
Jeremy Kemper
ab0ce052ba
Introduce transaction_joinable flag to mark that the fixtures transaction can't joined, a new savepoint is required even if :requires_new is not set. Use :requires_new option instead of :nest. Update changelog.
...
[#383 state:committed]
2009-01-10 13:39:37 -08:00
Jeremy Kemper
223a1d9451
Merge branch 'master' into savepoints
2009-01-10 12:14:44 -08:00
Pratik Naik
7c81a1ea93
Minor changes to AR#delete/destroy docs
2009-01-10 18:52:59 +00:00
Pratik Naik
b6f33d6bf8
Merge commit 'mainstream/master'
...
Conflicts:
activerecord/lib/active_record/base.rb
2009-01-10 18:43:27 +00:00
Chris Kampmeier
c4193d9f8e
Rewrite ActiveRecord::Base#destroy_all docs to remove incorrect info, mention return value, and improve clarity
...
(The incorrect information is "at least 2*N database queries" -- it's N+1 at best.)
2009-01-06 22:51:57 -08:00
Pratik Naik
82443ecfad
Merge commit 'fred/pullable'
2008-12-30 17:50:17 +00:00
Mike Gunderloy
220dff4c3b
Add transaction check to SQLite2 adapter to fix test_sqlite_add_column_in_transaction_raises_statement_invalid [ #1669 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-12-30 03:07:30 +00:00
Xavier Noria
9c3c88a894
document edge cases in AR calculations, and wrap some comments
2008-12-30 02:45:23 +01:00
Chris Kampmeier
477d37a0fb
Rewrite ActiveRecord::Base#delete docs to remove false information about callbacks, mention return value, and improve clarity
2008-12-29 03:05:05 -05:00
Daniel Schierbeck
bf95e5a802
Made code segments and method names have fixed-width fonts
2008-12-29 03:00:22 +01:00
Pratik Naik
d6c2285e31
Merge commit 'mainstream/master'
2008-12-28 20:00:29 +00:00
David Heinemeier Hansson
0efec64520
Merge branch 'master' of git@github.com:rails/rails
2008-12-28 20:53:58 +01:00
Yaroslav Markin
66ee5890c5
Introduce dynamic scopes for ActiveRecord: you can now use class methods like scoped_by_user_name(user_name) and scoped_by_user_name_and_password(user_name, password) that will use the scoped method with attributes you supply. [ #1648 state:committed]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-12-28 20:52:46 +01:00
Xavier Noria
a2270ef259
Inline code comments for class_eval/module_eval [ #1657 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-12-28 19:49:28 +00:00
Pratik Naik
aaea12c497
Revert inline docs
2008-12-28 16:01:38 +00:00
Chris Kampmeier
1ea13fce1a
Rewrite ActiveRecord::Base.delete docs for clarity, and mention return value
2008-12-27 18:03:19 -05:00
Xavier Noria
6adfbf2844
adds inline docs for dynamically created methods in Active Record
2008-12-27 20:25:41 +01:00
Yaroslav Markin
28347d889b
Refactor ActiveRecord::Base#new_record? [ #1647 state:committed]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-12-27 15:25:39 +01:00
Frederick Cheung
afdec83ed5
Fix to_sentence being used with options removed by 273c77
2008-12-27 14:16:17 +00:00
Yaroslav Markin
6e98adfc8e
ActiveRecord::Base#new_record? now returns false for existing records (was nil) [ #1219 state:committed]
...
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com >
2008-12-27 14:36:11 +01:00
Yaroslav Markin
fa0502494e
It is better to have this commented out to let locale-checking scripts perform better (rails-i18n)
2008-12-27 13:27:54 +03:00
Roman Shterenzon
21efba464a
Fix HasManyAssociation#create ignoring the :primary_key option [ #1633 state:resolved]
...
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-27 01:10:29 +00:00
Frederick Cheung
f9cab0e503
Fix :include of has_one with :primary_key option
2008-12-26 23:26:37 +00:00
Frederick Cheung
7db1704068
Fix :include of has_many associations with :primary_key option
2008-12-26 23:17:56 +00:00
Frederick Cheung
5cebe69e74
Preload uses exclusive scope [ #643 state:resolved]
...
With self referential associations, the scope for the the top level should not affect fetching of associations, for example
when doing
Person.male.find :all, :include => :friends
we should load all of the friends for each male, not just the male friends.
2008-12-26 18:25:55 +00:00
Pivotal Labs
eb457ceee1
Association preloading no longer stops if it hits a nil object [ #1630 state:resolved]
...
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-26 18:25:50 +00:00
Pivotal Labs
fe9239e9c6
Documentation for merged joins
2008-12-26 17:29:45 +00:00
Joshua Peek
aa002c0e86
ActiveRecord::QueryCache middleware
2008-12-22 11:31:18 -06:00
Luis Hurtado
63aac33833
Ensure of Model#create support custom updated_at and updated_on attributes [ #1612 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-12-22 15:19:33 +00:00
Daniel Luz
f7bd0beb67
Ensure Model#last doesn't affects order for another finders inside the same scope [ #1499 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-12-21 23:24:06 +00:00
Frederick Cheung
b17b9371c6
Fix configure_dependency_for_has_many not quoting conditions properly [ #1461 state:resolved]
2008-12-21 15:57:48 +00:00
Yaroslav Markin
276ea48de9
Remove dead commented out code [ #1467 state:resolved]
...
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-21 15:55:42 +00:00
Karthik Krishnan
75a133f92f
Fix has many through not quoting table names [ #1163 state:resolved]
...
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-20 21:08:51 +00:00
Pratik Naik
c3f53f412c
Merge docrails
2008-12-19 14:27:43 +00:00
Matt Jones
a9422cc1db
Fix preloading of has_one :through associations on belongs_to [ #1507 state:resolved]
...
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-18 19:19:36 +00:00
Manfred Stienstra
8326b95169
Free MySQL::Result objects after a call to execute [ #1416 state:resolved]
...
No freeing Result objects causes the MySQL driver to free result sets
at undefined times, this can lead to erratic performance in your
application.
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com >
2008-12-18 19:19:36 +00:00
Frederick Cheung
9c7fe7c672
Don't include table_name twice
2008-12-18 19:19:36 +00:00
Frederick Cheung
c9ab7098be
Ensure :include checks joins when determining if it can preload [ #528 state:resolved]
2008-12-18 19:19:36 +00:00