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