2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-05-23 22:48:32 -04:00
|
|
|
class CategoryGroup < ActiveRecord::Base
|
|
|
|
belongs_to :category
|
|
|
|
belongs_to :group
|
2013-07-13 21:24:16 -04:00
|
|
|
|
2015-09-17 03:51:32 -04:00
|
|
|
delegate :name, to: :group, prefix: true
|
|
|
|
|
2013-07-13 21:24:16 -04:00
|
|
|
def self.permission_types
|
2018-04-20 15:25:28 -04:00
|
|
|
@permission_types ||= Enum.new(full: 1, create_post: 2, readonly: 3)
|
2013-07-13 21:24:16 -04:00
|
|
|
end
|
|
|
|
|
2013-05-23 22:48:32 -04:00
|
|
|
end
|
|
|
|
|
2013-05-23 22:35:14 -04:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: category_groups
|
|
|
|
#
|
2013-07-13 21:24:16 -04:00
|
|
|
# id :integer not null, primary key
|
|
|
|
# category_id :integer not null
|
|
|
|
# group_id :integer not null
|
2014-08-27 01:19:25 -04:00
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
2013-07-13 21:24:16 -04:00
|
|
|
# permission_type :integer default(1)
|
2013-05-23 22:35:14 -04:00
|
|
|
#
|
2019-10-23 05:30:43 -04:00
|
|
|
# Indexes
|
|
|
|
#
|
|
|
|
# index_category_groups_on_group_id (group_id)
|
|
|
|
#
|