2010-07-08 12:16:36 -04:00
|
|
|
class User
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_protected :admin
|
|
|
|
|
|
|
|
public :sanitize_for_mass_assignment
|
|
|
|
end
|
|
|
|
|
2011-04-23 06:50:29 -04:00
|
|
|
class SpecialUser
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_accessible :name, :email, :as => :moderator
|
|
|
|
|
|
|
|
public :sanitize_for_mass_assignment
|
|
|
|
end
|
|
|
|
|
2010-07-08 12:16:36 -04:00
|
|
|
class Person
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_accessible :name, :email
|
2011-04-23 06:50:29 -04:00
|
|
|
attr_accessible :name, :email, :admin, :as => :admin
|
2010-07-08 12:16:36 -04:00
|
|
|
|
|
|
|
public :sanitize_for_mass_assignment
|
|
|
|
end
|
|
|
|
|
|
|
|
class Firm
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
|
|
|
|
public :sanitize_for_mass_assignment
|
|
|
|
|
|
|
|
def self.attributes_protected_by_default
|
|
|
|
["type"]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Task
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_protected :starting
|
|
|
|
|
|
|
|
public :sanitize_for_mass_assignment
|
|
|
|
end
|
|
|
|
|
|
|
|
class LoosePerson
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_protected :credit_rating, :administrator
|
2011-04-23 06:50:29 -04:00
|
|
|
attr_protected :credit_rating, :as => :admin
|
2010-07-08 12:16:36 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
class LooseDescendant < LoosePerson
|
|
|
|
attr_protected :phone_number
|
|
|
|
end
|
|
|
|
|
|
|
|
class LooseDescendantSecond< LoosePerson
|
|
|
|
attr_protected :phone_number
|
|
|
|
attr_protected :name
|
|
|
|
end
|
|
|
|
|
|
|
|
class TightPerson
|
|
|
|
include ActiveModel::MassAssignmentSecurity
|
|
|
|
attr_accessible :name, :address
|
2011-04-23 06:50:29 -04:00
|
|
|
attr_accessible :name, :address, :admin, :as => :admin
|
2010-07-08 12:16:36 -04:00
|
|
|
|
|
|
|
def self.attributes_protected_by_default
|
|
|
|
["mobile_number"]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class TightDescendant < TightPerson
|
|
|
|
attr_accessible :phone_number
|
2011-04-23 06:50:29 -04:00
|
|
|
attr_accessible :super_powers, :as => :admin
|
2010-07-08 12:16:36 -04:00
|
|
|
end
|