Skip to content

Conversation

JuanPabloDiaz
Copy link
Collaborator

This pull request includes several updates to dependencies, helper methods, and model logic, as well as some cleanup and refactoring. The most significant changes involve updating gem dependencies, refactoring the URLHelper module, and improving the Conference model's URL handling. Below are the key changes grouped by theme:

Dependency Updates:

  • Updated loofah gem from ~> 2.3.1 to ~> 2.21, rails from ~> 6.1.7.8 to ~> 7.1.3, sidekiq from ~> 4.1.3 to ~> 6.5.10, and mocha from 1.7.0 to ~> 2.0 in the Gemfile. These updates bring in newer versions of the libraries, ensuring compatibility and security. [1] [2]

Helper Refactoring:

  • Refactored URLHelper to a new module in app/helpers/url_helper.rb with a simplified fix_url method. Removed the old URLHelper class from app/lib/url_helper.rb and added a new implementation in lib/url_helper.rb for broader usage. [1] [2] [3]

Model Enhancements:

  • Updated the Conference model to use the new URLHelper.fix_url method for normalizing URLs (url, cfpUrl, cocUrl) and moved the fix_url method to a before_validation callback for better lifecycle management. Removed the old fix_url method implementation. [1] [2] [3]

Logic Improvements:

  • Enhanced add_related_topic in the Conference model to ensure no duplicate topics are added when computing related topics.

Cleanup:

  • Fixed a missing else branch in the Topic model's related_topic method, ensuring proper handling of unmatched cases.
  • Updated config.load_defaults in config/application.rb from version 5.1 to 5.2 to align with the Rails upgrade.

dependabot bot and others added 2 commits July 15, 2025 23:42
Bumps [sidekiq](https://github.com/sidekiq/sidekiq) from 4.1.4 to 6.5.10.
- [Changelog](https://github.com/sidekiq/sidekiq/blob/main/Changes.md)
- [Commits](sidekiq/sidekiq@v4.1.4...v6.5.10)

---
updated-dependencies:
- dependency-name: sidekiq
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
tech-conferences#100
Move URL helper logic from app/lib to lib directory and simplify implementation
Update Rails version to 7.1.3 and related gem dependencies
Fix topic model to return nil in else case and add related topics in conference model
@JuanPabloDiaz JuanPabloDiaz requested a review from nimzco July 16, 2025 00:13
@JuanPabloDiaz
Copy link
Collaborator Author

This PR originated from investigating compatibility issues after a dependency update (#100), which led to discovering and fixing several URL-related issues throughout the codebase.

Please let me know what you guys think

Copy link
Member

Choose a reason for hiding this comment

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

Why are there 2 URLHelper?

related_topics = topics.map { |topic| Topic.related_topic(topic) }.compact.uniq
related_topics.each do |related_topic|
self.topics << related_topic unless self.topics.include?(related_topic)
end
Copy link
Member

Choose a reason for hiding this comment

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

Is this a bug you've noticed somewhere? Why this refactor?

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.

2 participants