vert-core 1.0.7 → 1.0.9

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: d8f35e42033c0b57709c21ae2e3bbaf4e94e3c742bebd4919073fd44b47091a2
4
- data.tar.gz: 927a34fbd9ea96d075b078d5335fec45b8fe8e43c07c37290cf78c086d8d12fe
3
+ metadata.gz: 5e9ceee576cdddacc533a45290cde686730de79c57c0a20b8398cf621c0fc65c
4
+ data.tar.gz: 99d8f01a4d8de26934bfd1be229862e1662a75ae4676a6800c8b29fd7bcb48d5
5
5
  SHA512:
6
- metadata.gz: 5862931b7f896f4c2f117d34375cce256318808c6de7756ddc08000cf3852657eea2c0b2bd95144fc00f2d1086ffb2b60c366b5805196543a8c4e2fc7fac9c36
7
- data.tar.gz: 22f55c110cb32c3efc352b1cdf1c4d4f5d7fa5cca03f4c5d797fedece0f0902d4bd96f26269c3c563843e0481407a1d4b80d396945237d9fc1eea4ea69d9c9d9
6
+ metadata.gz: 3a17deed08b37000bd9be258c3c7b5218c9bf112f8f144f08199fccad3341e7b696c31c145b80966ffa50faf3bfd784330ba848f2a641fcb51ba2447cd519362
7
+ data.tar.gz: 881df24d6e3c2f8b50e2d3400feb771712f7a1f94f80bffe2e26444a7087dae4e008902f014921e3e4fd292e666b8ab4b6e9a5ecfe0e6a8bbdb695286ea3b90b
@@ -11,7 +11,7 @@ module Vert
11
11
  validates :aggregate_id, presence: true
12
12
  validates :payload, presence: true
13
13
  validates :status, presence: true
14
- enum :status, { pending: 0, published: 1, failed: 2 }, prefix: true
14
+ enum :status, { pending: "pending", published: "published", failed: "failed" }, prefix: true
15
15
  scope :pending_events, -> { status_pending.order(:created_at) }
16
16
  scope :failed_events, -> { status_failed.where("retry_count < ?", max_retry_count).order(:created_at) }
17
17
  scope :by_aggregate, ->(type, id) { where(aggregate_type: type, aggregate_id: id) }
@@ -7,9 +7,9 @@ module Vert
7
7
  def set_context(tenant_id:, company_id: nil, user_id: nil)
8
8
  return unless tenant_id.present?
9
9
  connection = ActiveRecord::Base.connection
10
- connection.execute(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_tenant_id = %s", tenant_id]))
11
- connection.execute(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_company_id = %s", company_id])) if company_id.present?
12
- connection.execute(ActiveRecord::Base.sanitize_sql(["SET LOCAL app.current_user_id = %s", user_id])) if user_id.present?
10
+ connection.execute("SET LOCAL app.current_tenant_id = #{connection.quote(tenant_id.to_s)}")
11
+ connection.execute("SET LOCAL app.current_company_id = #{connection.quote(company_id.to_s)}") if company_id.present?
12
+ connection.execute("SET LOCAL app.current_user_id = #{connection.quote(user_id.to_s)}") if user_id.present?
13
13
  Vert::Current.rls_configured = true
14
14
  rescue StandardError => e
15
15
  Rails.logger.error("[Vert::RLS] #{e.message}") if defined?(Rails)
data/lib/vert/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vert
4
- VERSION = "1.0.7"
4
+ VERSION = "1.0.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vert Team