Show More
Commit Description:
add model solution
Commit Description:
add model solution
File last commit:
Show/Diff file:
Action:
app/models/group_user.rb | 7 lines | 265 B | text/x-ruby | RubyLexer |
class GroupUser < ActiveRecord::Base
self.table_name = 'groups_users'
belongs_to :user
belongs_to :group
validates_uniqueness_of :user_id, scope: :group_id, message: ->(object, data) { "'#{User.find(data[:value]).full_name}' is already in the group" }
end