Sha256: e3ee72388b3c0130b97cbf076aaaf9123c78200cbe9feb722ae50f3ae6f6c0e4
Contents?: true
Size: 1.16 KB
Versions: 28
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true # :reek:UtilityFunction module RubyRabbitmqJanus module Models # Add class methods for JanusInstance model module Instances extend ActiveSupport::Concern # Class methods for Janus Instance model module ClassMethods # Disable an instance def disable(session_id) JanusInstance.find_by(session: session_id).set(enable: false) end # Clean all instance disabled def destroys JanusInstance.where(enable: false).delete_all end # Search a record by instance number def find_by_instance(instance_search) JanusInstance.find_by(instance: instance_search) rescue false end # Search a record by session number def find_by_session(session_search) JanusInstance.find_by(session: session_search) rescue nil end # Get all instance active def enabled JanusInstance.where(enable: true) end # Get all instance not active def disabled JanusInstance.where(enable: false) end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems