OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/models/principal_role.rb

14 lines
303 B

class PrincipalRole < ActiveRecord::Base
belongs_to :principal
belongs_to :role
def validate
add_error_can_not_be_assigned unless self.role.assignable_to?(self.principal)
end
private
def add_error_can_not_be_assigned
self.errors.add_to_base l(:error_can_not_be_assigned)
end
end