Sha256: 5b790b36ad0c4f84389b15107a64892174d527fa6128f070416131e95defd66f
Contents?: true
Size: 637 Bytes
Versions: 64
Compression:
Stored size: 637 Bytes
Contents
class Evento include ActiveModel::API include ActionText::Attribute extend Enumerize attr_accessor :tooltip, :target, :message, :message_text, :type, :record_type, :record_id, :subject, :user_ids validates :target, :type, :message, presence: true enumerize :target, in: { todos: 0, devs: 1, user_ids: 2 } validates :message_text, :subject, presence: true, if: lambda { type == 'EmailUserNotifier' } validates :user_ids, presence: true, if: lambda { target == 'user_ids' } def record return if record_id.blank? record_type.constantize.find(record_id) end end
Version data entries
64 entries across 64 versions & 1 rubygems