test for nccu
This commit is contained in:
parent
893c4686cb
commit
f2d460101f
|
@ -40,10 +40,6 @@ class Admin::NewsAdminsController < OrbitAdminController
|
|||
redirect_to admin_news_admins_path
|
||||
end
|
||||
|
||||
def unit_params
|
||||
params.require(:unit).permit!
|
||||
end
|
||||
|
||||
def get_departments
|
||||
unit = Unit.find(Sanitize.clean(params[:unit]))
|
||||
departments = unit.departments.collect do |d|
|
||||
|
@ -55,4 +51,10 @@ class Admin::NewsAdminsController < OrbitAdminController
|
|||
render :json => {"departments" => departments}.to_json
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def unit_params
|
||||
params.require(:unit).permit!
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -11,14 +11,4 @@ class Unit
|
|||
|
||||
accepts_nested_attributes_for :departments, :allow_destroy => true
|
||||
|
||||
# after_save :save_departments
|
||||
|
||||
def save_departments
|
||||
self.departments.each do |t|
|
||||
if t.should_destroy
|
||||
t.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue