aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body_heading.rb
diff options
context:
space:
mode:
authorlizconlan <liz@mysociety.org>2014-08-04 18:48:04 +0100
committerLouise Crow <louise.crow@gmail.com>2014-09-22 12:39:03 +0100
commit7df6456d69d71e6dba34fbc0d7b3d262d2dc0d38 (patch)
tree96b34f9e7fbcd7be5fcf0ef0042b10b1b58e222f /app/models/public_body_heading.rb
parent31c1f47a6bca88b2be9fb463721fb26698e79f82 (diff)
Add display order to public body categories and headings
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