Wrap text
Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
def users_within_country
country_clans = self.find_all_by_country(self.country)
unless country_clans.empty?
clans_users = []
country_clans.each do |clan|
clans_users += clan.users
end
results = attach_needed_user_data(clans_users)
else
results = []
end
results
end
|
Rails console
1
2
3
4
5
6
7
|
>> flc
=>
>> country_clans = Clan.find_all_by_country(flc.country)
=> [
>> flc.users_within_country
NoMethodError: undefined method `find_all_by_country' for #<Clan:0x1031f50c8>
|