Remove unneeded functionality from Event
This commit is contained in:
parent
63aeca0402
commit
408457a765
@ -3,7 +3,6 @@ class Event < ActiveRecord::Base
|
|||||||
validates :length, presence: true, numericality: {only_integer: true, greater_than: 0}
|
validates :length, presence: true, numericality: {only_integer: true, greater_than: 0}
|
||||||
validates :abstract, presence: true
|
validates :abstract, presence: true
|
||||||
validates :description, presence: true
|
validates :description, presence: true
|
||||||
validates :track_id, inclusion: { in: (Conference.current.try(:tracks) || []).map(&:id) }
|
|
||||||
validates :agreement, acceptance: true
|
validates :agreement, acceptance: true
|
||||||
|
|
||||||
belongs_to :track
|
belongs_to :track
|
||||||
@ -12,8 +11,6 @@ class Event < ActiveRecord::Base
|
|||||||
belongs_to :candidate_speaker, class_name: 'User', foreign_key: 'user_id'
|
belongs_to :candidate_speaker, class_name: 'User', foreign_key: 'user_id'
|
||||||
has_and_belongs_to_many :speakers, class_name: 'SpeakerProfile'
|
has_and_belongs_to_many :speakers, class_name: 'SpeakerProfile'
|
||||||
|
|
||||||
after_create :send_new_event_notification
|
|
||||||
|
|
||||||
enum state: [:undecided, :approved, :rejected, :backup]
|
enum state: [:undecided, :approved, :rejected, :backup]
|
||||||
|
|
||||||
scope :confirmed, -> { where.not confirmed_at: nil }
|
scope :confirmed, -> { where.not confirmed_at: nil }
|
||||||
@ -22,18 +19,13 @@ class Event < ActiveRecord::Base
|
|||||||
STATE_TO_GLYPH = {undecided: 'question-sign', rejected: 'remove', approved: 'ok', backup: 'retweet'}
|
STATE_TO_GLYPH = {undecided: 'question-sign', rejected: 'remove', approved: 'ok', backup: 'retweet'}
|
||||||
STATE_TO_CLASS = {undecided: 'warning', rejected: 'danger', approved: 'success', backup: 'info'}
|
STATE_TO_CLASS = {undecided: 'warning', rejected: 'danger', approved: 'success', backup: 'info'}
|
||||||
|
|
||||||
def send_acceptance_notification!
|
|
||||||
EventMailer.acceptance_notification(self).deliver
|
|
||||||
touch :acceptance_notification_sent_at
|
|
||||||
end
|
|
||||||
|
|
||||||
def confirmed?
|
def confirmed?
|
||||||
!!confirmed_at
|
!!confirmed_at
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def send_new_event_notification
|
def self.inheritance_column
|
||||||
EventMailer.new_event_notification(self).deliver
|
'something'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user