Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

collection need to setup their associations as well

  • Loading branch information...
commit f2c005e041c25691e7036ef98c48d527c2d6ec3d 1 parent 38c2812
Christian Meier authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 app/serializers/user_serializer.rb
11 app/serializers/user_serializer.rb
View
@@ -93,8 +93,13 @@ class UserSerializer < Ixtlan::Babel::Serializer
def setup_associations(options = {})
methods = ((((options || {})[:include] || {})[:groups] || {})[:methods] || [])
[:applications, :application_ids, :domains, :locales, :regions ].each do |m|
-
- to_model.groups.each { |g| g.send( m, self ) } if methods.member? m
+ if collection?
+ each do |i|
+ i.groups.each { |g| g.send( m, i ) } if methods.member? m
+ end
+ else
+ to_model.groups.each { |g| g.send( m, self ) } if methods.member? m
+ end
end
end
@@ -102,6 +107,6 @@ def setup_associations(options = {})
def setup_filter(options = nil)
super
- setup_associations( filter.options ) unless collection?
+ setup_associations( filter.options )
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.