Sha256: 7f49fd9e8e0bccb1678daaec29d182a2845756f56f55f083469237f6eef2725d

Contents?: true

Size: 927 Bytes

Versions: 5

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

module RubyRabbitmqJanus
  module Models
    # @author VAILLANT Jeremy <jeremy.vaillant@dazzl.tv>
    #
    # Store instance information for MongoID database
    class JanusInstance < ::ActiveRecord::Base
      include RubyRabbitmqJanus::Models::JanusInstanceCallbacks
      include RubyRabbitmqJanus::Models::JanusInstanceMethods
      include RubyRabbitmqJanus::Models::JanusInstanceValidations

      alias_attribute :instance,    :id
      alias_attribute :session_id,  :session
      alias_attribute :thread_id,   :thread

      after_create      { callback_create_after }
      after_update      { callback_update_after }
      after_destroy     { callback_destroy_after }

      private

      # Update attributes to document
      #
      # @param [Hash] List of attribute to update with this value
      def set(attributes)
        update_columns(attributes)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-2.2.0.pre.168 lib/rrj/models/active_record.rb
ruby_rabbitmq_janus-2.2.0.pre.167 lib/rrj/models/active_record.rb
ruby_rabbitmq_janus-2.2.0.pre.166 lib/rrj/models/active_record.rb
ruby_rabbitmq_janus-2.2.0.pre.165 lib/rrj/models/active_record.rb
ruby_rabbitmq_janus-2.2.0.pre.164 lib/rrj/models/active_record.rb