Sha256: e185ca3b343a212a77fc87a8d78c70739ee0543ed6443382e9aaa05e1d7857db
Contents?: true
Size: 705 Bytes
Versions: 9
Compression:
Stored size: 705 Bytes
Contents
# frozen_string_literal: true module Signum module ActiveRecordHelpers extend ActiveSupport::Concern class_methods do def signalable has_many :signals, as: :signalable, class_name: 'Signum::Signal' send :include, Signum::ActiveRecordHelpers::InstanceMethods extend(Signum::ActiveRecordHelpers::ClassMethods) end end module ClassMethods end module InstanceMethods def online! update(presence: 'online') end def offline! update(presence: 'offline') end def appeared! update(presence: 'appeared') end def away! update(presence: 'away') end end end end
Version data entries
9 entries across 9 versions & 1 rubygems