effective_products 0.1.0 → 0.1.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: 71749ac4354aa808c63c7400a6488b93222d840597eb2c845cbf91fd716d7626
4
- data.tar.gz: 0b03925757372551acb5ed7d0cf403f777f399b6ba4124ea65a387ce570e03b7
3
+ metadata.gz: 11a058d2af660cecc167db7c68d34813d400bb65d4fe71c983dd543b77f1bf74
4
+ data.tar.gz: c815c2d731ed89a9700d6f32e694c512af60b7a7404d8fc173cd7c497cf6508d
5
5
  SHA512:
6
- metadata.gz: 1939852347cbaa992d8563e6518c998af279b3fd69f6dd6287b2e9c076002419a6cef6e1245098c4e20e9846759c69c69eb6ff34ac8953b048dc69c28fc3b514
7
- data.tar.gz: afa4d7b300e9c2aba2d67e65eb2dc0c7a7b6a58b28073cc2818058552c0c345f84e1ec32b332d18f16e525c06d5b52cad070d84696782a3ccb3a0fcc638ef285
6
+ metadata.gz: 6d80c772b8bf58c9902d551f2d05d13829cb5490e5c1cd584e076466ef699bf1a50b1d2ed75c4584fa5da0bd02d05dea37efccfd986471da465bdea098c4065c
7
+ data.tar.gz: 18d173346225ff749ab36406bb8ad552e2c102fb1d860d4c40ecf91bc974736633f9549fd7a0dfcd8893960ff6c5a570c7f6e32b3b1ce1cdac09c08d58d94f27
@@ -49,10 +49,10 @@ module Effective
49
49
  scope :deep, -> { includes(:owner) }
50
50
 
51
51
  scope :with_approved_applicants, -> { where(applicant_id: EffectiveMemberships.Applicant.approved) }
52
- scope :with_stamp_wizards, -> { where(applicant_id: nil).where.not(stamp_wizard_id: nil) }
52
+ scope :with_stamp_wizards, -> { purchased.where(applicant_id: nil).where.not(stamp_wizard_id: nil) }
53
53
 
54
54
  scope :ready_to_issue, -> {
55
- with_approved_applicants.or(with_stamp_wizards).purchased.where.not(status: :issued)
55
+ with_approved_applicants.or(with_stamp_wizards).where.not(status: :issued)
56
56
  }
57
57
 
58
58
  validates :category, presence: true, inclusion: { in: CATEGORIES }
@@ -86,7 +86,7 @@ module Effective
86
86
  # Called by an application when submitted
87
87
  # Called by a stamp wizard when submitted
88
88
  def submit!
89
- raise('expected a purchased order') unless purchased?
89
+ raise('expected a purchased order') unless (purchased? || applicant&.submit_order&.purchased?)
90
90
  submitted!
91
91
  end
92
92
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveProducts
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_products
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2023-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails