Created
February 7, 2017 02:28
-
-
Save anonymous/35fc024590a7aa943ea041598070c99c to your computer and use it in GitHub Desktop.
does self do an inner join on i
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent < ActiveRecord::Base | |
has_many :children | |
#Question: Does method below perform a join in children and match only children belonging to a specific parent? | |
def has_active_children | |
if self.children.exists?(:status => "active") | |
return true | |
else | |
return false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment