app/controllers/schools_controller.rb in scidea-schools-1.0.0 vs app/controllers/schools_controller.rb in scidea-schools-1.0.1
- old
+ new
@@ -5,15 +5,17 @@
def index
@selected_school = params[:new_school_id] ? School.where("id = ?", params[:new_school_id]).first : nil
@schools = School.learner_form_search(params[:zipcode], @selected_school)
- render_success
+ render_success
end
def create
@school = School.new params[:school]
-
+
+ @school.approved = current_user && current_user.is_admin?
+
if @school && @school.save
render :json => @school.to_client_model_json
else
render_error
end