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

[403] Allows foreign key to_sym on Array #408

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julienemo
Copy link

This is not my original idea !!!!
MadBomber had this idea and personnally it helped me. I thought I might just as well make a PR

Original issue here
#403

@panteo
Copy link

panteo commented Mar 29, 2024

Can someone merge this PR please?

@panteo
Copy link

panteo commented Mar 29, 2024

It can also be implemented like this:

      def foreign_key?
        @domain.relationships_by_entity_name(@model.name).map(&:associations).flatten.map { |associaton|
          [associaton.send(Domain.foreign_key_method_name)].flatten.map(&:to_sym).join("_")
        }.include?(name.to_sym)
      end

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