Sha256: 272090919c6686da79d5f218f2773eded798363350efe0d6086e9cee73764f85

Contents?: true

Size: 638 Bytes

Versions: 12

Compression:

Stored size: 638 Bytes

Contents

module Rubix
  module Associations
    module BelongsToUserGroup

      def user_group= ug
        return unless ug
        @user_group    = ug
        @user_group_id = ug.id
      end

      def user_group
        return @user_group if @user_group
        return unless @user_group_id
        @user_group = UserGroup.find(:id => @user_group_id)
      end

      def user_group_id= ugid
        return unless ugid
        @user_group_id = ugid
      end

      def user_group_id
        return @user_group_id if @user_group_id
        return unless @user_group
        @user_group_id = @user_group.id
      end

    end
  end
end

      

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubix-0.5.14 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.13 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.9 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.8 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.7 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.6 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.5 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.4 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.3 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.2 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.1 lib/rubix/associations/belongs_to_user_group.rb
rubix-0.5.0 lib/rubix/associations/belongs_to_user_group.rb