aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/info_request.rb17
-rw-r--r--config/initializers/alaveteli.rb2
-rw-r--r--lib/configuration.rb4
-rw-r--r--locale/es_NI/app.po10
-rw-r--r--spec/models/info_request_spec.rb16
5 files changed, 34 insertions, 15 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index fd42ccd9c..7f6b358db 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -904,21 +904,24 @@ public
# Completely delete this request and all objects depending on it
def fully_destroy
- self.track_things.each do |track_thing|
+ track_things.each do |track_thing|
track_thing.track_things_sent_emails.each { |a| a.destroy }
track_thing.destroy
end
- self.user_info_request_sent_alerts.each { |a| a.destroy }
- self.info_request_events.each do |info_request_event|
+ user_info_request_sent_alerts.each { |a| a.destroy }
+ info_request_events.each do |info_request_event|
info_request_event.track_things_sent_emails.each { |a| a.destroy }
info_request_event.destroy
end
- self.mail_server_logs.each do |mail_server_log|
+ mail_server_logs.each do |mail_server_log|
mail_server_log.destroy
end
- self.outgoing_messages.each { |a| a.destroy }
- self.incoming_messages.each { |a| a.destroy }
- self.destroy
+ outgoing_messages.each { |a| a.destroy }
+ incoming_messages.each { |a| a.destroy }
+ comments.each { |comment| comment.destroy }
+ censor_rules.each{ |censor_rule| censor_rule.destroy }
+
+ destroy
end
# Called by incoming_email - and used to be called to generate separate
diff --git a/config/initializers/alaveteli.rb b/config/initializers/alaveteli.rb
index ade2c6e35..54fb5f870 100644
--- a/config/initializers/alaveteli.rb
+++ b/config/initializers/alaveteli.rb
@@ -10,7 +10,7 @@ load "debug_helpers.rb"
load "util.rb"
# Application version
-ALAVETELI_VERSION = '0.21.0.16'
+ALAVETELI_VERSION = '0.21.0.18'
# Add new inflection rules using the following format
# (all these examples are active by default):
diff --git a/lib/configuration.rb b/lib/configuration.rb
index 837e03cf9..7921b93fa 100644
--- a/lib/configuration.rb
+++ b/lib/configuration.rb
@@ -64,8 +64,8 @@ module AlaveteliConfiguration
:RESPONSIVE_STYLING => true,
:SITE_NAME => 'Alaveteli',
:SKIP_ADMIN_AUTH => false,
- :SMTP_MAILER_ADDRESS => '',
- :SMTP_MAILER_PORT => 587,
+ :SMTP_MAILER_ADDRESS => 'localhost',
+ :SMTP_MAILER_PORT => 25,
:SMTP_MAILER_DOMAIN => '',
:SMTP_MAILER_USER_NAME => '',
:SMTP_MAILER_PASSWORD => '',
diff --git a/locale/es_NI/app.po b/locale/es_NI/app.po
index 3e3d3c4b8..a14a1e249 100644
--- a/locale/es_NI/app.po
+++ b/locale/es_NI/app.po
@@ -19,8 +19,8 @@ msgstr ""
"Project-Id-Version: alaveteli\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-24 10:21+0000\n"
-"PO-Revision-Date: 2015-04-15 05:21+0000\n"
-"Last-Translator: jbaezni <jbaezni@gmail.com>\n"
+"PO-Revision-Date: 2015-04-16 08:38+0000\n"
+"Last-Translator: Gareth Rees <gareth@mysociety.org>\n"
"Language-Team: Spanish (Nicaragua) (http://www.transifex.com/projects/p/alaveteli/language/es_NI/)\n"
"Language: es_NI\n"
"MIME-Version: 1.0\n"
@@ -248,8 +248,8 @@ msgstr "<strong><code>status:</code></strong> para filtrar en función del estad
msgid "<strong><code>tag:charity</code></strong> to find all public authorities or requests with a given tag. You can include multiple tags, \\n and tag values, e.g. <code>tag:openlylocal AND tag:financial_transaction:335633</code>. Note that by default any of the tags\\n can be present, you have to put <code>AND</code> explicitly if you only want results them all present."
msgstr ""
-"<strong><code>tag:salud</code></strong> para buscar todos los Entidades Públicas o solicitudes con la etiqueta dada. Puedes incluir múltiples etiquetas, \n"
-" y valores, e.g. <code>tag:salud AND tag:financial_transaction:335633</code>. Por defecto, basta con que cualquiera de las etiquetas\n"
+"<strong><code>tag:salud</code></strong> para buscar todas las Entidades Públicas o solicitudes con la etiqueta dada. Puedes incluir múltiples etiquetas, \n"
+" y valores, e.g. <code>tag:salud AND tag:no_de_recibo:335633</code>. Por defecto, basta con que cualquiera de las etiquetas\n"
" esté presente, añade <code>AND</code> explícitamente si sólo quiere resultados con todas ellas presentes."
msgid "<strong><code>variety:</code></strong> to select type of thing to search for, see the <a href=\"{{varieties_url}}\">table of varieties</a> below."
@@ -3759,7 +3759,7 @@ msgstr[0] "Sus {{count}} solicitudes por bloques"
msgstr[1] "Sus {{count}} solicitudes por bloques"
msgid "Your {{law_used_full}} request has been sent"
-msgstr "Su {{law_used_full}} solicitud ha sido enviada"
+msgstr "Su {{law_used_full}} solicitud de información ha sido enviada"
msgid "Your {{site_name}} email alert"
msgstr "Tu alerta en {{site_name}}"
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index 70947584b..c8bd2c338 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -1313,4 +1313,20 @@ describe InfoRequest do
end
+
+ describe 'when destroying a message' do
+
+ it 'can destroy a request with comments and censor rules' do
+ info_request = FactoryGirl.create(:info_request)
+ censor_rule = FactoryGirl.create(:censor_rule, :info_request => info_request)
+ comment = FactoryGirl.create(:comment, :info_request => info_request)
+ info_request.reload
+ info_request.fully_destroy
+
+ InfoRequest.where(:id => info_request.id).should be_empty
+ CensorRule.where(:id => censor_rule.id).should be_empty
+ Comment.where(:id => comment.id).should be_empty
+ end
+
+ end
end