mirror of
https://github.com/discourse/discourse.git
synced 2024-12-21 08:43:46 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
33 lines
583 B
Ruby
33 lines
583 B
Ruby
# frozen_string_literal: true
|
|
|
|
class BadgeGrouping < ActiveRecord::Base
|
|
|
|
GettingStarted = 1
|
|
Community = 2
|
|
Posting = 3
|
|
TrustLevel = 4
|
|
Other = 5
|
|
|
|
has_many :badges
|
|
|
|
def system?
|
|
id && id <= 5
|
|
end
|
|
|
|
def default_position=(pos)
|
|
self.position ||= pos
|
|
end
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: badge_groupings
|
|
#
|
|
# id :integer not null, primary key
|
|
# name :string not null
|
|
# description :text
|
|
# position :integer not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|