FIX: allow position to be changed post seed

This commit is contained in:
Sam 2014-07-27 11:33:33 +10:00
parent 782773f774
commit 0ab456b647
2 changed files with 9 additions and 5 deletions

View file

@ -7,6 +7,10 @@ class BadgeGrouping < ActiveRecord::Base
Other = 5
has_many :badges
def default_position=(pos)
position ||= pos
end
end
# == Schema Information

View file

@ -2,31 +2,31 @@
BadgeGrouping.seed do |g|
g.id = BadgeGrouping::GettingStarted
g.name = "Getting Started"
g.position = 10
g.default_position = 10
end
BadgeGrouping.seed do |g|
g.id = BadgeGrouping::Community
g.name = "Community"
g.position = 11
g.default_position = 11
end
BadgeGrouping.seed do |g|
g.id = BadgeGrouping::Posting
g.name = "Posting"
g.position = 12
g.default_position = 12
end
BadgeGrouping.seed do |g|
g.id = BadgeGrouping::TrustLevel
g.name = "Trust Level"
g.position = 13
g.default_position = 13
end
BadgeGrouping.seed do |g|
g.id = BadgeGrouping::Other
g.name = "Other"
g.position = 14
g.default_position = 14
end
# BUGFIX