Class: Organizations::Groups::TransferValidator
- Inherits:
-
Object
- Object
- Organizations::Groups::TransferValidator
- Includes:
- ActiveModel::Validations
- Defined in:
- app/services/organizations/groups/transfer_validator.rb
Instance Method Summary collapse
- #can_transfer? ⇒ Boolean
- #error_message ⇒ Object
-
#initialize(group:, new_organization:, current_user:) ⇒ TransferValidator
constructor
A new instance of TransferValidator.
Constructor Details
#initialize(group:, new_organization:, current_user:) ⇒ TransferValidator
Returns a new instance of TransferValidator.
8 9 10 11 12 |
# File 'app/services/organizations/groups/transfer_validator.rb', line 8 def initialize(group:, new_organization:, current_user:) @group = group @new_organization = new_organization @current_user = current_user end |
Instance Method Details
#can_transfer? ⇒ Boolean
14 15 16 |
# File 'app/services/organizations/groups/transfer_validator.rb', line 14 def can_transfer? .nil? end |
#error_message ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/services/organizations/groups/transfer_validator.rb', line 18 def return [:group_not_root] unless group_is_root? return [:same_organization] if same_organization? return [:permission] unless nil end |