Class: Decidim::AuthorizationTransferRecord
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::AuthorizationTransferRecord
- Defined in:
- app/models/decidim/authorization_transfer_record.rb
Overview
Represents an authorization transfer record, i.e. a Decidim record object which was transferred from another user to the target user during an authorization transfer.
Instance Method Summary collapse
-
#readonly? ⇒ Boolean
Overwrites the method so that records cannot be modified.
-
#type ⇒ String
Returns the resource type for the records which is the value of the resource_type column stored for the record or the mapped_resource_type for the resource if it responds to that method.
Instance Method Details
#readonly? ⇒ Boolean
Overwrites the method so that records cannot be modified.
14 15 16 |
# File 'app/models/decidim/authorization_transfer_record.rb', line 14 def readonly? !new_record? && !destroyed_by_association end |
#type ⇒ String
Returns the resource type for the records which is the value of the resource_type column stored for the record or the mapped_resource_type for the resource if it responds to that method.
For example, Decidim::Coauthorable records need to report a model that they represent instead of “Coauthorable” because otherwise e.g. proposal transfers would not be reported correctly.
27 28 29 |
# File 'app/models/decidim/authorization_transfer_record.rb', line 27 def type resource.try(:mapped_resource_type) || resource_type end |