Sha256: 94574c33b94ac5dfa42befccdd0d074a75833c34763342531475e84cb706178e

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

class Apisync
  module Rails
    class Extensions
      def self.setup

        ActiveSupport.on_load(:active_record) do
          ::ActiveRecord::Base.send(:include, Apisync::ActiveRecordExtension)
        end

        if defined?(::Sidekiq)
          sidekiq_klass = ::Apisync::Rails::SyncModelJob::Sidekiq

          # Don't include twice the same module
          unless sidekiq_klass.included_modules.include?(::Sidekiq::Worker)
            sidekiq_klass.send(:include, ::Sidekiq::Worker)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
apisync-rails-0.3.0 lib/apisync/rails/extensions.rb
apisync-rails-0.1.2 lib/apisync/rails/extensions.rb
apisync-rails-0.1.1 lib/apisync/rails/extensions.rb
apisync-rails-0.0.4 lib/apisync/rails/extensions.rb
apisync-rails-0.0.3 lib/apisync/rails/extensions.rb