Skip to content

Commit

Permalink
members include ancestors when serialized to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzido committed Oct 18, 2017
1 parent c2f949c commit 9189e78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mondrian_rest/mondrian_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def to_h(member_properties: [], get_children: false, member_caption: nil, get_me
if get_members
rv[:members] = self.members
.uniq { |m| m.property_value('MEMBER_KEY') }
.map { |m| m.to_h(member_properties, member_caption, get_children) }
.map { |m|
m.to_h(member_properties, member_caption, get_children)
.merge({ancestors: m.ancestors.map(&:to_h)})
}
end
rv
end
Expand Down

0 comments on commit 9189e78

Please sign in to comment.