First crack
This commit is contained in:
9
app/models/group.rb
Normal file
9
app/models/group.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Group < ApplicationRecord
|
||||
has_many :user_groups, dependent: :destroy
|
||||
has_many :users, through: :user_groups
|
||||
has_many :application_groups, dependent: :destroy
|
||||
has_many :applications, through: :application_groups
|
||||
|
||||
validates :name, presence: true, uniqueness: { case_sensitive: false }
|
||||
normalizes :name, with: ->(name) { name.strip.downcase }
|
||||
end
|
||||
Reference in New Issue
Block a user