discourse/app/models/badge_grouping.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
678 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
class BadgeGrouping < ActiveRecord::Base
GettingStarted = 1
Community = 2
Posting = 3
TrustLevel = 4
Other = 5
2014-07-17 02:10:44 -04:00
has_many :badges
validates :name, length: { maximum: 100 }
validates :description, length: { maximum: 500 }
2014-07-27 04:22:01 -04:00
def system?
id && id <= 5
2014-07-27 04:22:01 -04:00
end
def default_position=(pos)
2014-07-27 04:32:04 -04:00
self.position ||= pos
end
end
2014-07-17 02:10:44 -04:00
# == Schema Information
#
# Table name: badge_groupings
#
# id :integer not null, primary key
2019-01-11 14:29:56 -05:00
# name :string not null
2014-07-21 22:46:31 -04:00
# description :text
2014-07-17 02:10:44 -04:00
# position :integer not null
# created_at :datetime not null
# updated_at :datetime not null
2014-07-17 02:10:44 -04:00
#