Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

setup associations only when user is given otherwise return old value

  • Loading branch information...
commit bd58ef6fd0b427ee1797a23a0711646d86ef2eb4 1 parent 532144d
@mkristian authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 app/models/group.rb
View
9 app/models/group.rb
@@ -33,21 +33,24 @@ def load_associations( model, method, user )
private :load_associations
def regions(user = nil)
- if has_regions
+ if has_regions && user
@regions = load_associations( GroupsRegionsUser, :region, user )
end
+ @regions
end
def locales(user = nil)
- if has_locales
+ if has_locales && user
@locales = load_associations( GroupsLocalesUser, :locale, user )
end
+ @locales
end
def domains(user = nil)
- if has_domains
+ if has_domains && user
@domains = load_associations( DomainsGroupsUser, :domain, user )
end
+ @domains
end
def applications(user = nil)
Please sign in to comment.
Something went wrong with that request. Please try again.