Sha256: 65beae1c2414cf36fa86b4985ff6dc9c3065a60ca3fab5c014a19798925ebc4c
Contents?: true
Size: 692 Bytes
Versions: 39
Compression:
Stored size: 692 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module Comments # Shared behaviour for commentable models with enabled, start_time and # end_time attributes for comments. module HasAvailabilityAttributes extend ActiveSupport::Concern included do # Public: Whether the object has comments allowed based on availability # attributes def comments_allowed? (!comments_enabled.nil? && comments_enabled) && (comments_start_time.blank? || comments_start_time <= Time.current) && (comments_end_time.blank? || comments_end_time > Time.current) end end end end end
Version data entries
39 entries across 39 versions & 1 rubygems