Skip to content

Commit

Permalink
Remove deprecated code. Fixes #2015.
Browse files Browse the repository at this point in the history
  • Loading branch information
crowbot committed Feb 26, 2015
1 parent 6096ba5 commit e651142
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 158 deletions.
5 changes: 0 additions & 5 deletions app/models/public_body_category.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ def self.without_headings
PublicBodyCategory.find_by_sql(sql)
end

# Called from the old-style public_body_categories_[locale].rb data files
def self.add(locale, data_list)
CategoryAndHeadingMigrator.add_categories_and_headings_from_list(locale, data_list)
end

# Convenience methods for creating/editing translations via forms
def find_translation_by_locale(locale)
translations.find_by_locale(locale)
Expand Down
2 changes: 0 additions & 2 deletions config/initializers/alaveteli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
require 'xapian_queries'
require 'date_quarter'
require 'public_body_csv'
require 'category_and_heading_migrator'
require 'public_body_categories'
require 'routing_filters'
require 'alaveteli_text_masker'

Expand Down
91 changes: 0 additions & 91 deletions lib/category_and_heading_migrator.rb

This file was deleted.

11 changes: 0 additions & 11 deletions lib/public_body_categories.rb

This file was deleted.

29 changes: 0 additions & 29 deletions spec/models/public_body_category_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe PublicBodyCategory do
describe 'when loading the data' do
it 'should use the display_order field to preserve the original data order' do
PublicBodyCategory.add(:en, [
"Local and regional",
[ "local_council", "Local councils", "a local council" ],
"Miscellaneous",
[ "other", "Miscellaneous", "miscellaneous" ],
[ "aardvark", "Aardvark", "daft test"],])

headings = PublicBodyHeading.all
cat_group1 = headings[0].public_body_categories
cat_group1.count.should eq 1
cat_group1[0].title.should eq "Local councils"

cat_group2 = headings[1].public_body_categories
cat_group2.count.should eq 2
cat_group2[0].title.should eq "Miscellaneous"
cat_group2[0].public_body_category_links.where(
:public_body_heading_id => headings[1].id).
first.
category_display_order.should eq 0

cat_group2[1].title.should eq "Aardvark"
cat_group2[1].public_body_category_links.where(
:public_body_heading_id => headings[1].id).
first.
category_display_order.should eq 1
end
end

context 'when validating' do

Expand Down
20 changes: 0 additions & 20 deletions spec/models/public_body_heading_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,6 @@

describe PublicBodyHeading do

context 'when loading the data' do

before do
PublicBodyCategory.add(:en, [
"Local and regional",
[ "local_council", "Local councils", "a local council" ],
"Miscellaneous",
[ "other", "Miscellaneous", "miscellaneous" ],])
end

it 'should use the display_order field to preserve the original data order' do
headings = PublicBodyHeading.all
headings[0].name.should eq 'Local and regional'
headings[0].display_order.should eq 0
headings[1].name.should eq 'Miscellaneous'
headings[1].display_order.should eq 1
end

end

context 'when validating' do

it 'should require a name' do
Expand Down

0 comments on commit e651142

Please sign in to comment.