Open crawfoal opened 6 years ago
Feel free to take this one as well when you get to it 🙂
Actually, now that I think about it, you should wait until I finish the PR I'm working on since it adds some big changes to the station model.
For this feature do you want the admin to have the ability to add coordinates to a station that was created without coordinates and to be able to add an address to one that was created with just coordinates?
Yes, but it should be one or the other. So adding in a coordinate for a station that was defined with an address would delete the address.
The form should probably make this more obvious. And actually, I'm not sure how the form object would currently handle things if a station was saved with both... I think it might successfully save both, and we need to fix that.
I can confirm that it saves both.
@crawfoal I have been working on this issue for awhile now and am starting to realize that having the update function for the station also act as a delete function and a create function for the nested objects within the station object is not something you can do without more code than belongs in an update method. I think a cleaner way to accomplish the functionality that you want is to include a delete method for the station and only allow an admin to edit the nested object that the station object was created with. Please let me know what you think. If you disagree with my suggestion and have the time, I would be grateful for any advice you could give me on how to accomplish the above stated functionality without a cluttered update method.
This is similar to the issue that I just completed (admins can edit prizes) and would be happy to take this issue. I can understand though if you want to leave this for someone's first pull request. If not let me know and I'll get working on it.