Change delete_all to destroy_all
This commit is contained in:
parent
3676de8a14
commit
61648d23e1
|
@ -88,7 +88,7 @@ class Admin::AssetsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
asset = Asset.any_in(:_id => params[:ids]).delete_all
|
||||
asset = Asset.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to assets_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -114,7 +114,7 @@ class Admin::DesignsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
designs = Design.any_in(:_id => params[:ids]).delete_all
|
||||
designs = Design.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to admin_designs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace :pages do
|
|||
|
||||
task :build => :environment do
|
||||
|
||||
Item.delete_all
|
||||
Item.destroy_all
|
||||
|
||||
|
||||
var_10 = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
|
||||
|
|
|
@ -4,8 +4,8 @@ namespace :site do
|
|||
|
||||
task :build => :environment do
|
||||
|
||||
Site.delete_all
|
||||
Purchase.delete_all
|
||||
Site.destroy_all
|
||||
Purchase.destroy_all
|
||||
|
||||
Site.create( :school => 'RulingDigital University', :department => 'Computer Science', :valid_locales => [ 'en', 'zh_tw' ], :in_use_locales => [ 'zh_tw', 'en' ])
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
bulletins = Bulletin.any_in(:_id => params[:ids]).delete_all
|
||||
bulletins = Bulletin.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_announcement_back_end_bulletins_url(:filter => params[:filter], :direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -271,7 +271,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_books = WritingBook.any_in(:_id => params[:ids]).delete_all
|
||||
writing_books = WritingBook.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_book_back_end_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -146,7 +146,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_books = WritingBook.any_in(:_id => params[:ids]).delete_all
|
||||
writing_books = WritingBook.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_book_plugin_writing_books_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -269,7 +269,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
|
||||
writing_conferences = WritingConference.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_conference_back_end_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -147,7 +147,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_conferences = WritingConference.any_in(:_id => params[:ids]).delete_all
|
||||
writing_conferences = WritingConference.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_conference_plugin_writing_conferences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -145,7 +145,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
diplomas = Diploma.any_in(:_id => params[:ids]).delete_all
|
||||
diplomas = Diploma.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_diploma_back_end_diplomas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -132,7 +132,7 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
diplomas = Diploma.any_in(:_id => params[:ids]).delete_all
|
||||
diplomas = Diploma.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_diploma_plugin_diplomas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -213,7 +213,7 @@ class Panel::PersonalExperience::BackEnd::ExperiencesController < OrbitBackendCo
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
experiences = Experience.any_in(:_id => params[:ids]).delete_all
|
||||
experiences = Experience.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_experience_back_end_experiences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -201,7 +201,7 @@ class Panel::PersonalExperience::Plugin::ExperiencesController < OrbitBackendCon
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
experiences = Experience.any_in(:_id => params[:ids]).delete_all
|
||||
experiences = Experience.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_experience_plugin_experiences_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -216,7 +216,7 @@ class Panel::PersonalHonor::BackEnd::HonorsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
honors = Honor.any_in(:_id => params[:ids]).delete_all
|
||||
honors = Honor.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_honor_back_end_honors_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -201,7 +201,7 @@ class Panel::PersonalHonor::Plugin::HonorsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
honors = Honor.any_in(:_id => params[:ids]).delete_all
|
||||
honors = Honor.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_honor_plugin_honors_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -323,7 +323,7 @@ class Panel::PersonalJournal::BackEnd::WritingJournalsController < OrbitBackendC
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_journals = WritingJournal.any_in(:_id => params[:ids]).delete_all
|
||||
writing_journals = WritingJournal.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_journal_back_end_writing_journals_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -147,7 +147,7 @@ class Panel::PersonalJournal::Plugin::WritingJournalsController < OrbitBackendCo
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_journals = WritingJournal.any_in(:_id => params[:ids]).delete_all
|
||||
writing_journals = WritingJournal.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_journal_plugin_writing_journals_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -152,7 +152,7 @@ class Panel::PersonalLab::BackEnd::LabsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
labs = Lab.any_in(:_id => params[:ids]).delete_all
|
||||
labs = Lab.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_lab_back_end_labs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -142,7 +142,7 @@ class Panel::PersonalLab::Plugin::LabsController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
labs = Lab.any_in(:_id => params[:ids]).delete_all
|
||||
labs = Lab.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_lab_plugin_labs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -213,7 +213,7 @@ class Panel::PersonalPatent::BackEnd::WritingPatentsController < OrbitBackendCon
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_patents = WritingPatent.any_in(:_id => params[:ids]).delete_all
|
||||
writing_patents = WritingPatent.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_patent_back_end_writing_patents_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -141,7 +141,7 @@ class Panel::PersonalPatent::Plugin::WritingPatentsController < OrbitBackendCont
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
writing_patents = WritingPatent.any_in(:_id => params[:ids]).delete_all
|
||||
writing_patents = WritingPatent.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_patent_plugin_writing_patents_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -213,7 +213,7 @@ class Panel::PersonalProject::BackEnd::ProjectsController < OrbitBackendControll
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
projects = Project.any_in(:_id => params[:ids]).delete_all
|
||||
projects = Project.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_project_back_end_projects_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -141,7 +141,7 @@ class Panel::PersonalProject::Plugin::ProjectsController < OrbitBackendControlle
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
projects = Project.any_in(:_id => params[:ids]).delete_all
|
||||
projects = Project.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_project_plugin_projects_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -140,7 +140,7 @@ class Panel::PersonalResearch::BackEnd::ResearchsController < OrbitBackendContro
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
researchs = Research.any_in(:_id => params[:ids]).delete_all
|
||||
researchs = Research.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_research_back_end_researchs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -127,7 +127,7 @@ class Panel::PersonalResearch::Plugin::ResearchsController < OrbitBackendControl
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
researchs = Research.any_in(:_id => params[:ids]).delete_all
|
||||
researchs = Research.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_personal_research_plugin_researchs_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
|
@ -128,7 +128,7 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
|||
|
||||
def delete
|
||||
if params[:ids]
|
||||
web_links = WebLink.any_in(:_id => params[:ids]).delete_all
|
||||
web_links = WebLink.any_in(:_id => params[:ids]).destroy_all
|
||||
end
|
||||
redirect_to panel_web_resource_back_end_web_links_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
|
||||
end
|
||||
|
|
Reference in New Issue