Home > Software design >  Rails: Search for the same string in two tables
Rails: Search for the same string in two tables

Time:06-11

Good evening guys, I'm new to rails and I'm using google translate to post here in English. a doubt.

I have the users table, and in it 2 columns

my_code_invite_win
indication_code

I would like to list all users of column "indication_code" who have the same code as "my_code_invite_win", how could I do this listing?

image_columns

CodePudding user response:

Users.where("my_code_invite_win = indication_code")

  • Related