-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include full address in ical event #1036
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timkaechele Thank you very much for your first Contribution 🎉
The change in general looks great. I added some requests to make the code more stable in the future.
@@ -10,7 +10,7 @@ def icalendar(*events) | |||
item.dtstart = event.date | |||
item.dtend = event.end_date | |||
item.url = event_url(event) | |||
item.location = event.location.name if event.location | |||
item.location = event.location.calendar_event_address if event.location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure that this feature will work in the future when the code base changes. Could you please add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need explicit tests for this or would the smoke testing in the events controller specs surfice, given that we already have the calendar event address test?
@@ -30,6 +30,14 @@ def address | |||
"#{street} #{house_number}, #{zip} #{city}" | |||
end | |||
|
|||
def calendar_event_address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure that this feature will work in the future when the code base changes. Could you please add a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added tests for this method here: https://github.com/rughh/on_ruby/pull/1036/files#diff-6b1dfa85c752473d93705b0802618ae524932f70ab05aee4f936f06886f2299dR46
When possible include the full address of the event's location in the ical event instead of just the location name
What it changes
This PR changes the ical events to actually include the address if present and only in the absence of a full address fall back to the name of the location
Why?
Because ruby user group events in Berlin are always at a different location, and I have trouble finding the place and the name of the location is not as helpful compared to an actual address your phone's calendar can help you find.