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
|
|
|
|
@permission_types ||= Enum.new(:full, :create_post, :readonly)
|
|
|
|
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
|
|
|
#
|