app/models/openstax/accounts/group.rb in openstax_accounts-3.1.1 vs app/models/openstax/accounts/group.rb in openstax_accounts-4.0.0
- old
+ new
@@ -82,25 +82,29 @@
def supertree_group_ids
return cached_supertree_group_ids unless cached_supertree_group_ids.nil?
return [] unless persisted?
reload
- gids = [id] + (Group.includes(:member_group_nestings)
- .where(member_group_nestings: {member_group_id: openstax_uid})
- .first.try(:supertree_group_ids) || [])
- update_column(:cached_supertree_group_ids, gids.to_yaml)
+ gids = [openstax_uid] + (Group.includes(:member_group_nestings)
+ .where(member_group_nestings: {
+ member_group_id: openstax_uid
+ })
+ .first.try(:supertree_group_ids) || [])
+ update_column(:cached_supertree_group_ids, gids)
self.cached_supertree_group_ids = gids
end
def subtree_group_ids
return cached_subtree_group_ids unless cached_subtree_group_ids.nil?
return [] unless persisted?
reload
- gids = [id] + Group.includes(:container_group_nesting)
- .where(container_group_nesting: {container_group_id: openstax_uid})
- .collect{|g| g.subtree_group_ids}.flatten
- update_column(:cached_subtree_group_ids, gids.to_yaml)
+ gids = [openstax_uid] + Group.includes(:container_group_nesting)
+ .where(container_group_nesting: {
+ container_group_id: openstax_uid
+ })
+ .collect{|g| g.subtree_group_ids}.flatten
+ update_column(:cached_subtree_group_ids, gids)
self.cached_subtree_group_ids = gids
end
protected