module Decidim::Authorable
This concern contains the logic related to single authorship.
Sometimes authorship may belong to a single user or be shared among coauthors, in this latest case the Coauthorable
concern should be used instead of Authorable
.
Public Instance Methods
official?()
click to toggle source
Public: Checks whether the resource is official or not.
Returns a boolean.
# File lib/decidim/authorable.rb, line 52 def official? decidim_author_type == Decidim::Organization.name end
user_group_membership()
click to toggle source
# File lib/decidim/authorable.rb, line 64 def user_group_membership return unless user_group errors.add :user_group, :invalid unless user_group.users.include? author end
verified_user_group()
click to toggle source
# File lib/decidim/authorable.rb, line 58 def verified_user_group return unless user_group errors.add :user_group, :invalid unless user_group.verified? end