Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Update partner request form to require at least 1 item #111

Closed
joshleichtung opened this issue Apr 1, 2019 · 9 comments
Closed

Update partner request form to require at least 1 item #111

joshleichtung opened this issue Apr 1, 2019 · 9 comments

Comments

@joshleichtung
Copy link
Collaborator

Currently, a partner can make a request without actually including any items. There should probably be validations around this, both in the form and perhaps in the data model.

Screen Shot 2019-03-31 at 4 51 26 PM

The above is a valid submission but should not be.
@Randond
Copy link
Contributor

Randond commented Apr 4, 2019

Hello, I am a student from Loyola, I would like to work on this issue. I cannot assign it to myself as we are only allowed to assign issues to ourselves that are in the Loyno team. As a result, I will make a copy of the issue over there and be working on it. I will inform you how this issue progresses.

@seanmarcia
Copy link
Member

Hey @joshleichtung and @Randond I think they should be able to make requests without items provided they have something in the comments. I can see a situation where a partner might send a request with just comments if they were looking for non-standard items. A comment like the following seems possible - "We are helping a teenage girl who was kicked out of her house and are trying to source her a crib, car seat, and a comfortable chair for her to sit in with the baby."

@Randond
Copy link
Contributor

Randond commented Apr 19, 2019

@joshleichtung @seanmarcia I'm having a little trouble with this issue. Do you think you could do a pairing session with me?

@seanmarcia
Copy link
Member

@Randond I'm a little packed this weekend but may have some time Monday. Can you push a branch with what you've done so far? I may be able to offer some suggestions!

@Randond
Copy link
Contributor

Randond commented Apr 20, 2019

@seanmarcia Here is a link to a pull request I just made. loyno-mathcs#19

@seanmarcia
Copy link
Member

seanmarcia commented Apr 21, 2019

Hey @Randond I took a look and the path you're going down could work but I think there is a simpler solution using rails validations.
You can take a read here about rails validations. I think something like the following should probably do what you're looking for:
validates :items, presence: { unless: :comments? }
Just customize and some tests to confirm it and we should be good to go!

@Randond
Copy link
Contributor

Randond commented Apr 23, 2019

@seanmarcia created new pull request loyno-mathcs#20

@benreyn
Copy link
Member

benreyn commented Jul 25, 2019

It looks like loyno-mathcs#20 got merged. @seanmarcia @mdworken @armahillo Im going to cherry pick that commit so that..

  1. @Randond gets credit for his contribution, and...
  2. We can close out this issue

@benreyn benreyn closed this as completed Jul 25, 2019
@benreyn
Copy link
Member

benreyn commented Jul 25, 2019

Fixed in #130

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants