Sha256: 0760cfdf428799103f94342bd90a727206a0e33f9f05b461003275d577a9e244

Contents?: true

Size: 329 Bytes

Versions: 7

Compression:

Stored size: 329 Bytes

Contents

class Group < ActiveRecord::Base
  validates_presence_of :name
  has_many :group_users
  has_many :role_groups
  has_many :roles, through: :role_groups
  has_many :users, through: :group_users
  accepts_nested_attributes_for :role_groups, reject_if: :all_blank, allow_destroy: :true
  scope :active, -> { where active: true }
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curupira-0.1.7 spec/dummy/app/models/group.rb
curupira-0.1.6 spec/dummy/app/models/group.rb
curupira-0.1.4 spec/dummy/app/models/group.rb
curupira-0.1.3 spec/dummy/app/models/group.rb
curupira-0.1.2 spec/dummy/app/models/group.rb
curupira-0.1.1 spec/dummy/app/models/group.rb
curupira-0.1.0 spec/dummy/app/models/group.rb