inboxable 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1207d628727126924ff331738cd526e2dc676964fae984d2b53c6cf97a664418
4
- data.tar.gz: 7163397c6d3bd6c90e3beca17957943dd38866d677b4c4057ddf1a14bcff9f33
3
+ metadata.gz: 7f796060bcb2461754d9c77a51ca4b5dfa638d3e5235af50be6ed58195187bd6
4
+ data.tar.gz: 8671ce2b6c55b7d1060466de3280ec066e407f5bd2c8fc617ee83c104034237d
5
5
  SHA512:
6
- metadata.gz: a0e65af5f85b964269d7e20525754ec0ebe8152ea9e3d946480af9ad29c973756a70bbd97a4034d11eb38bc97b777e618b58daae4afc19825c99c00ec21c3e3a
7
- data.tar.gz: b9da958286397e8b9fc7f165af001a5a234d4e582cf971b6fc6f21f29574078928cb12c6d6b52c99e5187c3867a540af0aca4be82e942c675c910217e8545b9f
6
+ metadata.gz: 2a63084c541d6da7d74c3b8fbfa8277574c7931d713dd4591cdc4043034391ed96eb51fa4b0a090c4e3bb551bc5e2d6b6c5b045f86e5af8d735b4dc2874d5c9b
7
+ data.tar.gz: ed83bb53ec33b7f8d32052c7216c8b3cf9573f9a373a709704fef6a214eca03fa5bd000bb802bb476d547fbffe274694e7ed3b02f24f13f382e32b093f225741
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2024-01-21
3
+ ## [0.1.1] - 2024-01-21
4
4
 
5
5
  - Initial release
@@ -2,7 +2,7 @@ module Inboxable
2
2
  class Configuration
3
3
  ALLOWED_ORMS = %i[activerecord mongoid].freeze
4
4
 
5
- attr_accessor :orm
5
+ attr_accessor :orm, :inbox_model
6
6
 
7
7
  def initialize
8
8
  raise Error, 'Sidekiq is not available. Unfortunately, sidekiq must be available for Inboxable to work' unless Object.const_defined?('Sidekiq')
@@ -23,5 +23,9 @@ module Inboxable
23
23
  def orm
24
24
  @orm || :activerecord
25
25
  end
26
+
27
+ def inbox_model
28
+ @inbox_model || 'Inbox'
29
+ end
26
30
  end
27
31
  end
@@ -9,7 +9,7 @@ module Inboxable
9
9
  end
10
10
 
11
11
  def perform_activerecord
12
- Inbox.pending
12
+ Inboxable.inbox_model.pending
13
13
  .where(last_attempted_at: [..Time.zone.now, nil])
14
14
  .find_in_batches(batch_size: ENV.fetch('INBOXABLE__BATCH_SIZE', 100).to_i)
15
15
  .each do |batch|
@@ -22,7 +22,7 @@ module Inboxable
22
22
 
23
23
  def perform_mongoid
24
24
  batch_size = ENV.fetch('INBOXABLE__BATCH_SIZE', 100).to_i
25
- Inbox.pending
25
+ Inboxable.inbox_model.pending
26
26
  .any_of({ last_attempted_at: ..Time.zone.now }, { last_attempted_at: nil })
27
27
  .each_slice(batch_size) do |batch|
28
28
  batch.each do |inbox|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Inboxable
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
data/lib/inboxable.rb CHANGED
@@ -10,6 +10,10 @@ module Inboxable
10
10
  class << self
11
11
  attr_accessor :configuration
12
12
 
13
+ def inbox_model
14
+ @configuration.inbox_model.constantize
15
+ end
16
+
13
17
  def configure
14
18
  @configuration ||= Configuration.new
15
19
  yield(@configuration) if block_given?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inboxable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Muhammad Nawzad