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

Fix class_name when in a namespace #22

Merged
merged 1 commit into from
Jun 29, 2022
Merged

Conversation

santib
Copy link
Owner

@santib santib commented Jun 28, 2022

No description provided.

# frozen_string_literal: true

module Payments
class Transaction < ActiveRecord::Base
Copy link
Collaborator

@sebaherrera07 sebaherrera07 Jun 28, 2022

Choose a reason for hiding this comment

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

I remember at some point in a project I tried to name a class Transaction and I had some unexpected errors. I checked and I also find this on stack overflow:
https://stackoverflow.com/questions/27388510/can-i-have-a-model-called-transaction-in-rails

Although one person says that it could have been due to the table name and here you specified another table name.

Just to mention that maybe another class name might be better to avoid having weird issues? 😅

Copy link
Collaborator

@sebaherrera07 sebaherrera07 left a comment

Choose a reason for hiding this comment

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

✅ 👏 . Left some minor comments

@santib santib force-pushed the fix-class-name-with-namespace branch from 19bebc7 to 3b7643f Compare June 29, 2022 21:08
@santib santib merged commit 0ebb4f4 into main Jun 29, 2022
@santib santib deleted the fix-class-name-with-namespace branch June 29, 2022 21:10
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