2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-07-16 21:25:16 -05:00
|
|
|
class BadgeGrouping < ActiveRecord::Base
|
2014-07-17 01:10:44 -05:00
|
|
|
|
2014-07-18 00:46:36 -05:00
|
|
|
GettingStarted = 1
|
|
|
|
Community = 2
|
|
|
|
Posting = 3
|
|
|
|
TrustLevel = 4
|
|
|
|
Other = 5
|
2014-07-17 01:10:44 -05:00
|
|
|
|
2014-07-16 21:25:16 -05:00
|
|
|
has_many :badges
|
2014-07-26 20:33:33 -05:00
|
|
|
|
2014-07-27 03:22:01 -05:00
|
|
|
def system?
|
2015-12-26 16:58:54 -06:00
|
|
|
id && id <= 5
|
2014-07-27 03:22:01 -05:00
|
|
|
end
|
|
|
|
|
2014-07-26 20:33:33 -05:00
|
|
|
def default_position=(pos)
|
2014-07-27 03:32:04 -05:00
|
|
|
self.position ||= pos
|
2014-07-26 20:33:33 -05:00
|
|
|
end
|
2014-07-16 21:25:16 -05:00
|
|
|
end
|
2014-07-17 01:10:44 -05:00
|
|
|
|
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: badge_groupings
|
|
|
|
#
|
|
|
|
# id :integer not null, primary key
|
2019-01-11 13:29:56 -06:00
|
|
|
# name :string not null
|
2014-07-21 21:46:31 -05:00
|
|
|
# description :text
|
2014-07-17 01:10:44 -05:00
|
|
|
# position :integer not null
|
2014-08-27 00:19:25 -05:00
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
2014-07-17 01:10:44 -05:00
|
|
|
#
|