Sha256: 60396f9fd6b2b118b33dff0af746e6a5086e57f8ea9edb0a5a6615380e7fc253
Contents?: true
Size: 719 Bytes
Versions: 12
Compression:
Stored size: 719 Bytes
Contents
module Rubix module Associations module HasManyUserGroups def user_groups= ugs return unless ugs @user_groups = ugs @user_group_ids = ugs.map(&:id) end def user_groups return @user_groups if @user_groups return unless @user_group_ids @user_groups = @user_group_ids.map { |ugid| UserGroup.find(:id => ugid) } end def user_group_ids= ugids return unless ugids @user_group_ids = ugids end def user_group_ids return @user_group_ids if @user_group_ids return unless @user_groups @user_group_ids = @user_groups.map(&:id) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems