Skip to content
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

Rails 7.2.2 #1929

Merged
merged 7 commits into from
Nov 6, 2024
Merged

Rails 7.2.2 #1929

merged 7 commits into from
Nov 6, 2024

Conversation

EGiataganas
Copy link
Member

Description of change

Rails 7.2.1

Story Link

https://trello.com/c/ZAd8mStM

@benjamineskola
Copy link
Contributor

benjamineskola commented Aug 27, 2024

It looks like we have a very old version of activerecord-postgis-adapter: 3.1.2 when the current is 9.0.2. I'm not sure why we have that version, which is older than BOPS itself, but I think this is the cause of the "uninitialised constant" errors.

However, the latest version (9.0.2) only supports Rails 7.1, so we'll need to wait for them to release a new version before we can update to Rails 7.2.

@EGiataganas
Copy link
Member Author

Yes I am aware of that, there's an open issue on the activerecord-postgis-adapter gem. Last month they merged a PR but it looks like is still not fully supported. So it will need to wait

@benjamineskola
Copy link
Contributor

Yep, just found the same; it looks like we could depend on the github version:

gem "activerecord-postgis-adapter", github: "rgeo/activerecord-postgis-adapter"

But I suggest waiting for an actual release unless we consider this upgrade urgent.

@EGiataganas EGiataganas marked this pull request as draft August 27, 2024 14:23
@benjamineskola benjamineskola force-pushed the rails-7.2.1 branch 2 times, most recently from 6e64a79 to a3adab1 Compare November 5, 2024 09:37
@benjamineskola benjamineskola changed the title Rails 7.2.1 Rails 7.2.2 Nov 5, 2024
@benjamineskola benjamineskola marked this pull request as ready for review November 5, 2024 10:38
@@ -7,7 +7,7 @@ class AddressValidationError < StandardError; end
has_many :neighbour_letters, dependent: :destroy
has_many :neighbour_responses, dependent: :destroy

enum source: {manual_add: "manual_add", map_selection: "map_selection", sent_comment: "sent_comment"}
enum :source, {manual_add: "manual_add", map_selection: "map_selection", sent_comment: "sent_comment"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can avoid the duplication here by doing this:

enum :source, %w[manual_add map_selection sent_comment].index_by(&:itself)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's useful to know, there were a few cases like this I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is better:

enum :source, %i[manual_add map_selection sent_comment].index_with(&:to_s)

That gives symbol keys and string values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naturally we have one enum where the keys use snake case and the values use kebab case, and another where the keys are lowercase and the values uppercase. I'm not sure those are worth trying to deduplicate.

@benjamineskola benjamineskola force-pushed the rails-7.2.1 branch 7 times, most recently from 13b3190 to aaa5db9 Compare November 5, 2024 11:30
@benjamineskola benjamineskola merged commit fcfc3c3 into main Nov 6, 2024
23 checks passed
@benjamineskola benjamineskola deleted the rails-7.2.1 branch November 6, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants