-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Requests and Donations now support multiple rows (#101)
* add javascript to dynamically load table * Split item selection into own form * Working in donation form; TODO: abstract out of here * Factoring out item selection to a partial * Refactoring object relationships * Refactored item system in database * Making todo more specific * Adding and removing rows with updating dropdowns * Validation appears functional * Editing and showing work * All displays updated * Commenting JS * Adding donations relationship to item_changes * Fixing lock file * Fixing webpack * Cleaning package.json * Authenticate Request#show (#112) * Added time checking to Request#show * Show the top 3 item requests in table (sorted by default by quantity)
- Loading branch information
1 parent
63b7db0
commit ed83e1c
Showing
35 changed files
with
457 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -319,4 +319,4 @@ RUBY VERSION | |
ruby 2.7.2p137 | ||
|
||
BUNDLED WITH | ||
2.2.8 | ||
2.2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
module ApplicationHelper | ||
|
||
# Given a list of attributes (key, value), returns true if any are blank | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ import "channels" | |
|
||
Rails.start() | ||
Turbolinks.start() | ||
ActiveStorage.start() | ||
ActiveStorage.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
class Category < ApplicationRecord | ||
has_many :items | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
class ItemChange < ApplicationRecord | ||
|
||
|
||
CHANGE_TYPES = { | ||
'request': 1, | ||
'donation': 2, | ||
}.freeze | ||
|
||
belongs_to :category | ||
belongs_to :request, optional: true | ||
belongs_to :donation, optional: true | ||
|
||
validates :change_type, inclusion: { in: CHANGE_TYPES.values } | ||
|
||
validates_presence_of :quantity, :itemType, :size | ||
|
||
validates_numericality_of :quantity, greater_than: 0 | ||
|
||
default_scope { order(quantity: :desc) } | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.