rails_settlement 1.4.0 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fea25e5290b99af4236253654e98e65428fbb8845cd3952ed57bddbfbd877aa5
4
- data.tar.gz: bf7b83e4dcd6cde28b6fbca6bf96db247ec07d75e4ea76ffa8caec1f775dc7e3
3
+ metadata.gz: e5babe02d110a7be58276f8db43f444866c28348919e0395a95b18a42400f4c8
4
+ data.tar.gz: 072ba56c5d56d4ac8114c73e31e3ef4674ae9ceca1412d7841dd1461788ed664
5
5
  SHA512:
6
- metadata.gz: 61f3e0eb9b9909119252dfda0cced54624da78f22c531bf6ae7b03cdd30e3be30485182fda294c83d01475b0df03e56ebd4ded6fdbd1875605e053a677b4dddf
7
- data.tar.gz: c19ca70fec032ce9b3ffb0868bbc92d4f4322a0138e1e5240d11a5581820b26824ae0ec2a13ef284c301c18b3b7abcb1d1c249e1224c9f0f366007a0d19ebbcc
6
+ metadata.gz: 83560391ae6716aef1cf12455dac296600b6a3b295a72a63cf276dca52ea119d6cda3e384cf427da9650d016bd4416dcc40f3181a7ed252837d08bc92f541704
7
+ data.tar.gz: 132e33a061a3b536c63f56ea391d9ba85465336561145ff18cc2cb1cb4b0a685ad6b1690529e4785af255b9f9354c19c2d845632cf14b5d5de0b48db87d09799
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSettlement
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.2"
5
5
  end
@@ -21,9 +21,9 @@ module RailsSettlement
21
21
  associated_to = _rs_handle_associated_to(options: options)
22
22
 
23
23
  before_action(**options) do
24
- scoped_klass = _rs_associated_scope(scoped_relation: scoped_klass, associated_to: associated_to)
24
+ query = _rs_associated_scope(scoped_relation: scoped_klass, associated_to: associated_to)
25
25
 
26
- instance_variable_set("@#{variable}", scoped_klass.find_by(param_options[:model_key] => params[param_options[:params_key]]))
26
+ instance_variable_set("@#{variable}", query.find_by(param_options[:model_key] => params[param_options[:params_key]]))
27
27
  raise ActiveRecord::RecordNotFound if raisable && instance_variable_get("@#{variable}").nil?
28
28
  end
29
29
 
@@ -69,7 +69,7 @@ module RailsSettlement
69
69
  def _rs_associated_scope(scoped_relation:, associated_to: nil)
70
70
  return scoped_relation if associated_to.blank?
71
71
 
72
- scoped_relation.where(associated_to => public_send(associated_to))
72
+ scoped_relation.joins(associated_to).where(associated_to => public_send(associated_to))
73
73
  end
74
74
  end
75
75
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_settlement
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tejas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-06 00:00:00.000000000 Z
11
+ date: 2024-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord