| Commit message (Collapse) | Author | Age | Lines |
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Moves the magic 'site_administration' tag logic to the PublicBody
model. Easier to make the string passed to `PublicBody#has_tag?` configurable
if we want to allow this to be set per install.
|
|/
|
|
| |
Picks these up in `rake notes` and adds semantic meaning
|
|
|
|
|
|
|
|
|
| |
Specifically using save! so that anything other than an
ActiveRecord::RecordInvalid doesn't get missed
Note that ActiveModel::Errors#full_messages includes the attribute key
in the message. This is by design, so we should consider whether we can
improve the way that we use translated validation messages.
|
|
|
|
|
| |
There's a unique index on public_bodies url_name, so we should have a
validation for that.
|
|
|
|
|
| |
Should have been run after related migrations.
Could automate this to always run after migrations.
|
|
|
|
|
|
|
|
| |
The internal admin body should be created automatically if it
doesn't exist on calls to PublicBody.internal_admin_body; we've
seen errors (#1001) where this fails after the default locale
changes. (Although these tests don't actually replicate that
problem.)
|
|\ |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under Ruby 1.8.7, you can parse a CSV file with the
following code (Example A):
require 'csv'
CSV.parse('foo.csv') do |row|
puts "got row: #{row.inspect}"
end
Rather confusingly, under Ruby 1.8.7, CSV.parse can also
take a string representation of the contents of the file
as its parameter, so this also works (Example B):
require 'csv'
CSV.parse("1,hello,red\n2,goodbye,green") do |row|
puts "got row: #{row.inspect}"
end
However under Ruby 1.9.3, CSV.parse only expects a string
representation of the contents of the CSV file, so only
Example B works; Example B fails silently (interpreting
the filename as a single cell CSV file, typically).
The import:import_csv rake task unfortunately relied on
both A and B working. This commit fixes this by adding
PublicBody.import_csv_from_file, and refactoring
PublicBody.import_csv to use the newly added class method,
and adds a test to check for any regression in this
behaviour.
(This means that the usage of import_csv in the admin public
body controller's import_csv action could now be changed
to use PublicBody.import_csv_from_file directly from the
uploaded file, which would be more efficient and cope
with larger files without using lots of memory.)
Fixes #1229
|
|
|
|
|
|
|
|
|
|
| |
In the initial release of public body statistics to WhatDoTheyKnow
a public body only intended for testing ("mySociety Test Quango")
was included in the statistics. This commit causes public bodies
tagged with "test" to be excluded from the public body statistics
page.
Fixes #1115.
|
|
|
|
|
|
|
|
| |
The WDTK volunteers pointed out that it's not fair to include
hidden requests in the denominator, since they're typically hidden
for a good reason (e.g. being vexatious, spam, etc.), and we have
no information about those that are awaiting_description (i.e.
unclassified) so they should be excluded as well.
|
|
|
|
|
|
| |
This counts only those info requests that have prominence 'normal'
(i.e. are not hidden) and are not 'awaiting_description' (i.e. that
they have had some basic status classification).
|
|
|
|
| |
These are regenerated with "bundle exec annotate"
|
|
|
|
| |
This causes several specs to fail.
|
|
|
|
|
|
|
|
| |
In the rare circumstance that someone created a public body
whose name started with a lower case letter outside [a-z]
with Alaveteli running under Ruby 1.8, the letter would not be
upcased correctly before saving to the first_letter column.
This commit fixes that by using a Unicode-aware upcase function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a public body called "Åčçèñtéd Authority" in the
Czech locale (cs) so that we can create tests that exercise,
for example, searching based on an initial letter that has a
multi-byte representation in UTF-8.
An old test for "add mass tags" in the admin needed to be updated
since it implicitly assumed that all the public bodies in the
fixtures had translations in the :en locale.
The tests for loading CSV files of public bodies also needed to
be updated, since they were assuming that public body names
only contained letters in [A-Za-z ]. Since Unicode character
classes aren't easily available in Ruby 1.8 and it makes little
difference to the test, the character class is replaced by '.'.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Gemfile
app/views/admin_request/edit_outgoing.html.erb
config/packages
doc/CHANGES.md
doc/INSTALL.md
spec/models/info_request_spec.rb
spec/models/public_body_spec.rb
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Check to see if the stripped version is different before setting it on
the record. If we don't do this, the subsequent call to write_attribute
in Globalize3 which uses attribute_will_change! means we're storing
versions when there hasn't really been any change.
|
|/ |
|
|
|
|
| |
the method to be stubbed and avoid side effects.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
instance - no need to keep applying the regex if called multiple times e.g. in a view.
|
| |
|
| |
|
| |
|
|
|
|
| |
defined
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The ad hoc specification of fixtures has been an ongoing source
of bugs in the tests. The straw that broke the camel’s back is
that 7c6eb09 requires the fixtures to be loaded in order (i.e.
children before their parents), and it would have been a painful
process to reorder all the dozens of different fixture lists,
but the test system ought to be more reliable this way.
|
|
|
|
|
| |
This was added for temporary debugging purposes, and ought to have
been removed.
|
|
|
|
|
|
|
|
| |
Previously many of the tests made assumptions about the global
structure of the test data set: the total number of requests, for
example, or the names of all public bodies. This makes it difficult
to add to the test data. This change is intended to make the test
data easier to extend by eliminating such global assumptions.
|
|
|
|
| |
Fixes #303.
|
|\
| |
| |
| |
| | |
Conflicts:
spec/controllers/request_controller_spec.rb
|
| | |
|
|/ |
|
|
|
|
| |
Fixes #193
|
| |
|
|
|
|
| |
Fixes #60
|
| |
|
| |
|
| |
|
| |
|