aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body_heading.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body_heading.rb')
-rw-r--r--app/models/public_body_heading.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/public_body_heading.rb b/app/models/public_body_heading.rb
index 6c7d645da..818940341 100644
--- a/app/models/public_body_heading.rb
+++ b/app/models/public_body_heading.rb
@@ -4,10 +4,15 @@
#
# id :integer not null, primary key
# name :text not null
+# display_order :integer
#
class PublicBodyHeading < ActiveRecord::Base
- has_and_belongs_to_many :public_body_categories
+ attr_accessible :name, :display_order, :translated_versions
+
+ has_many :public_body_category_links
+ has_many :public_body_categories, :order => :category_display_order, :through => :public_body_category_links
+ default_scope order('display_order ASC')
translates :name