discourse/app/models/topic_allowed_group.rb
Ian Christian Myers 0d01c33482 Enabled strong_parameters across all models/controllers.
All models are now using ActiveModel::ForbiddenAttributesProtection, which shifts the responsibility for parameter whitelisting for mass-assignments from the model to the controller. attr_accessible has been disabled and removed as this functionality replaces that.

The require_parameters method in the ApplicationController has been removed in favor of strong_parameters' #require method.

It is important to note that there is still some refactoring required to get all parameters to pass through #require and #permit so that we can guarantee that parameter values are scalar. Currently strong_parameters, in most cases, is only being utilized to require parameters and to whitelist the few places that do mass-assignments.
2013-06-06 00:30:59 -07:00

21 lines
521 B
Ruby

class TopicAllowedGroup < ActiveRecord::Base
belongs_to :topic
belongs_to :group
validates_uniqueness_of :topic_id, scope: :group_id
end
# == Schema Information
#
# Table name: topic_allowed_groups
#
# id :integer not null, primary key
# group_id :integer not null
# topic_id :integer not null
#
# Indexes
#
# index_topic_allowed_groups_on_group_id_and_topic_id (group_id,topic_id) UNIQUE
# index_topic_allowed_groups_on_topic_id_and_group_id (topic_id,group_id) UNIQUE
#