Ruby On Rails in UA Icon_home Главная Add to bookmarks Translate translate Profile Войти
Регистрация Форум Блоги Пользователи Список джемов Rails проекты      Поиск   

Ruby On Rails in UA/Программирование на ROR/Удаление связи при has and belongs to many/RE: Удаление связи при has and belongs to many

2008-06-10 06:34:23 Ответить  
admin
Ruslan Voloshin
Адрес: odessa
Сообщений: 1226
Регистр: 2007-03-13
его блог 40 сообщ.
RE: Удаление связи при has and belongs to many
  •  
Если я правильно понят твою задачу ты просто хочешь почистить таблицу и удалить все записи из таблицы Role

destroy_all(conditions = nil)
Destroys the objects for all the records that match the condition by instantiating each object and calling the destroy method. Example:



delete_all(conditions = nil)

Deletes the records matching conditions without instantiating the records first, and hence not calling the destroy method and invoking callbacks. This is a single SQL query, much more efficient than destroy_all.
Options

conditions Conditions are specified the same way as with find method.
Example

This deletes the affected posts all at once with a single DELETE query. If you need to destroy dependent associations or call your before_ or after_destroy callbacks, use the destroy_all method instead.
------------
Занимаюсь вебом и продвижением сайтов.
,
Назадназад Новыйновый Ответитьответить
Ключевые слова:
Гости: 133 Онлайн: 0
Rambler's Top100
О проекте по всем вопросам обращайтесь на support
Rubyclub.com.ua Copyright © 2007 - 2008