Skip to content

Commit af15745

Browse files
committed
1 parent 66c4a38 commit af15745

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

Gemfile.lock

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ GEM
308308
image_processing (1.13.0)
309309
mini_magick (>= 4.9.5, < 5)
310310
ruby-vips (>= 2.0.17, < 3)
311-
importmap-rails (2.0.1)
311+
importmap-rails (2.0.3)
312312
actionpack (>= 6.0.0)
313313
activesupport (>= 6.0.0)
314314
railties (>= 6.0.0)
@@ -482,16 +482,16 @@ GEM
482482
puma (6.4.3)
483483
nio4r (~> 2.0)
484484
racc (1.8.1)
485-
rack (2.2.10)
486-
rack-protection (3.1.0)
487-
rack (~> 2.2, >= 2.2.4)
488-
rack-session (1.0.2)
489-
rack (< 3)
485+
rack (3.1.8)
486+
rack-protection (4.0.0)
487+
base64 (>= 0.1.0)
488+
rack (>= 3.0.0, < 4)
489+
rack-session (2.0.0)
490+
rack (>= 3.0.0)
490491
rack-test (2.1.0)
491492
rack (>= 1.3)
492-
rackup (1.0.1)
493-
rack (< 3)
494-
webrick
493+
rackup (2.2.0)
494+
rack (>= 3)
495495
rails (7.2.2)
496496
actioncable (= 7.2.2)
497497
actionmailbox (= 7.2.2)
@@ -629,10 +629,11 @@ GEM
629629
simplecov_json_formatter (~> 0.1)
630630
simplecov-html (0.12.3)
631631
simplecov_json_formatter (0.1.4)
632-
sinatra (3.1.0)
632+
sinatra (4.0.0)
633633
mustermann (~> 3.0)
634-
rack (~> 2.2, >= 2.2.4)
635-
rack-protection (= 3.1.0)
634+
rack (>= 3.0.0, < 4)
635+
rack-protection (= 4.0.0)
636+
rack-session (>= 2.0.0, < 3)
636637
tilt (~> 2.0)
637638
slop (3.6.0)
638639
smart_properties (1.17.0)

app/models/account_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AccountRequest < ApplicationRecord
3030

3131
has_one :organization, dependent: :nullify
3232

33-
enum status: %w[started user_confirmed admin_approved rejected admin_closed].map { |v| [v, v] }.to_h
33+
enum :status, %w[started user_confirmed admin_approved rejected admin_closed].map { |v| [v, v] }.to_h
3434

3535
scope :requested, -> { where(status: %w[started user_confirmed]) }
3636
scope :closed, -> { where(status: %w[admin_approved rejected admin_closed]) }

app/models/distribution.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class Distribution < ApplicationRecord
4545

4646
before_save :combine_distribution, :reset_shipping_cost
4747

48-
enum state: { scheduled: 5, complete: 10 }
49-
enum delivery_method: { pick_up: 0, delivery: 1, shipped: 2 }
48+
enum :state, { scheduled: 5, complete: 10 }
49+
enum :delivery_method, { pick_up: 0, delivery: 1, shipped: 2 }
5050
scope :active, -> { joins(:line_items).joins(:items).where(items: { active: true }) }
5151
# add item_id scope to allow filtering distributions by item
5252
scope :by_item_id, ->(item_id) { joins(:items).where(items: { id: item_id }) }

app/models/partner.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Partner < ApplicationRecord
2727
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
2828
].freeze
2929

30-
enum status: { uninvited: 0, invited: 1, awaiting_review: 2, approved: 3, error: 4, recertification_required: 5, deactivated: 6 }
30+
enum :status, { uninvited: 0, invited: 1, awaiting_review: 2, approved: 3, error: 4, recertification_required: 5, deactivated: 6 }
3131

3232
belongs_to :organization
3333
belongs_to :partner_group, optional: true

app/models/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Request < ApplicationRecord
3030
accepts_nested_attributes_for :item_requests, allow_destroy: true, reject_if: proc { |attributes| attributes["quantity"].blank? }
3131
has_many :child_item_requests, through: :item_requests
3232

33-
enum status: { pending: 0, started: 1, fulfilled: 2, discarded: 3 }, _prefix: true
33+
enum :status, { pending: 0, started: 1, fulfilled: 2, discarded: 3 }, _prefix: true
3434

3535
validates :distribution_id, uniqueness: true, allow_nil: true
3636
validate :item_requests_uniqueness_by_item_id

spec/models/item_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
it { should validate_presence_of(:name) }
3838
it { should belong_to(:organization) }
39-
it { should belong_to(:base_item).counter_cache(:item_count).with_primary_key(:partner_key).with_foreign_key(:partner_key).inverse_of(:items) }
4039
it { should validate_numericality_of(:distribution_quantity).is_greater_than(0) }
4140
it { should validate_numericality_of(:on_hand_minimum_quantity).is_greater_than_or_equal_to(0) }
4241
it { should validate_numericality_of(:on_hand_recommended_quantity).is_greater_than_or_equal_to(0) }

0 commit comments

Comments
 (0)