| 2008-06-10 03:09:12 | Ответить |
|---|---|
|
Sergey V Адрес: Сообщений: 57 Регистр: 2007-08-06 его блог 0 сообщ. |
Cascade deleting - Каскадное удаление |
|
Как оно работает в Рельсах и можно ли им управлять?
|
|
| Cascade deleting |
| 2008-06-07 16:45:50 | Ответить |
|---|---|
|
Ruslan Voloshin Адрес: odessa Сообщений: 1226 Регистр: 2007-03-13 его блог 40 сообщ. |
RE: Cascade deleting - Каскадное удаление |
|
has_many(association_id, options = {}, &extension)
------------
# :dependent - если установить в :destroy все асоциированые обекты будут удалены с вызомом destroy для этиъ объектов. Если установить в :delete_all все асоциативные оьъекты будут адалены без вызова для них destroy методов. Если установить в :nullify все associated objects’ внешние ключи будут становлены в NULL без вызова для них save callbacks. NOTE: :dependent => true is deprecated and has been replaced with :dependent => :destroy. May not be set if :exclusively_dependent is also set. # :exclusively_dependent - Deprecated; equivalent to :dependent => :delete_all. If set to true all the associated object are deleted in one SQL statement without having their before_destroy callback run. This should only be used on associations that depend solely on this class and don’t need to do any clean-up in before_destroy. The upside is that it’s much faster, especially if there’s a counter_cache involved. May not be set if :dependent is also set. Занимаюсь вебом и продвижением сайтов.
|
|
| has_many |