Implemented strong_parameters for Category/CategoriesController.

Category now requires parameters to be permitted by strong_parameters using #require or #permit for mass-assignment. Missing required parameters now throw a ActionController::ParameterMissing execption instead of the Discourse::InvalidParameters execption.
This commit is contained in:
Ian Christian Myers
2013-06-04 23:45:25 -07:00
parent 870e59883b
commit 130d837952
3 changed files with 13 additions and 9 deletions

View File

@@ -1,4 +1,6 @@
class Category < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
belongs_to :topic, dependent: :destroy
belongs_to :topic_only_relative_url,
select: "id, title, slug",