Skip to content

Commit

Permalink
Fixes #12676 - Filter contains two attr_accessible declarations
Browse files Browse the repository at this point in the history
The 2nd one was just the leftovers of the old declaration.
Organization/location attr_accessible are loaded via Taxonomies, and
:unlimited was missing from the first declaration so I moved it there.
  • Loading branch information
dLobatog authored and Dominic Cleal committed Dec 7, 2015
1 parent 420ab77 commit 0dbd3e7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/models/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ class Filter < ActiveRecord::Base
include Taxonomix
include Authorizable

attr_accessible :role_id, :resource_type, :permissions, :search,
:permission_ids, :permission_names
attr_writer :resource_type
attr_accessor :unlimited
attr_accessible :search, :unlimited, :resource_type, :permissions,
:permission_ids, :permission_names, :role_id

class ScopedSearchValidator < ActiveModel::Validator
def validate(record)
Expand All @@ -23,11 +25,6 @@ def add_current_location?
false
end

attr_accessible :search, :resource_type, :permission_ids, :role_id, :unlimited,
:organization_ids, :location_ids
attr_writer :resource_type
attr_accessor :unlimited

belongs_to :role
has_many :filterings, :dependent => :destroy
has_many :permissions, :through => :filterings
Expand Down

0 comments on commit 0dbd3e7

Please sign in to comment.