mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
Available during registration or after conference Co-authored-by: Shyukri <shshyukriev@suse.com> Co-authored-by: Henne <hvogel@opensuse.org> Co-authored-by: Moises <mdeniz@suse.com>
13 lines
350 B
Ruby
13 lines
350 B
Ruby
class Survey < ActiveRecord::Base
|
|
belongs_to :surveyable, polymorphic: true
|
|
has_many :survey_questions
|
|
has_many :survey_submissions
|
|
|
|
enum target: [:after_conference, :during_registration]
|
|
validates :title, presence: true
|
|
|
|
def active?
|
|
now = Time.now.in_time_zone(surveyable.timezone)
|
|
now >= start_date && now <= end_date
|
|
end
|
|
end
|