aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/info_request.rb
Commit message (Collapse)AuthorAgeLines
* Discard rejected responses with malformed From:Gareth Rees2015-05-13-1/+6
| | | | | | | | | Stops the RequestMailer trying to send a stopped_responses mail if the To: address can’t be parsed from the incoming message. ArgumentError: An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address.
* Add explaining commentsGareth Rees2015-05-13-0/+2
|
* Sensible error messageGareth Rees2015-05-13-1/+1
|
* Tidy InfoRequest#initial_request_textGareth Rees2015-04-27-5/+2
|
* Only load the outgoing messages that will be usedGareth Rees2015-04-27-1/+1
| | | | | | | | | | | | | | | | Prevents loading of all outgoing messages related to the info request. Before OutgoingMessage Load (1.5ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at After OutgoingMessage Load (0.8ms) SELECT "outgoing_messages".* FROM "outgoing_messages" WHERE "outgoing_messages"."info_request_id" = 137 ORDER BY created_at LIMIT 1
* Allow custom states to be tested.Louise Crow2015-02-09-5/+3
| | | | | | Since https://github.com/mysociety/alaveteli/commit/80ad2d4c31075ffc994e8c48ea25e6e3c486c364 no themes have been loaded by tests unless explicitly specified, so I think it's safe to remove the code added in https://github.com/mysociety/alaveteli/commit/3dfc53f6b82b3c5da79a4c710d45b859f61f4f5f
* Remove unused lineLouise Crow2015-02-09-1/+0
|
* Remove duplicate method.Louise Crow2015-01-12-10/+0
|
* Merge branch 'brakeman_fixes' into rails-3-developLouise Crow2014-12-18-3/+3
|\
| * Improve InfoRequest.find_in_state SQLGareth Rees2014-12-18-3/+3
| |
* | Refactor the application of masks and censor rules to messages.Louise Crow2014-12-15-0/+16
| | | | | | | | | | | | | | | | | | | | Seems more logical to make this one method that figures out what to do based on file type. Plus, incoming message does so many things, it seemed like having these related methods be separate would make them easier to read and understand. Also, email, mobile and login substitution texts weren't being translated. Finally, I think passing the censor rules and masks as arguments is a first step in some more decoupling of models.
* | Only mark email_subject_request as HTML safe when used in email subject.Louise Crow2014-12-12-4/+9
|/ | | | It's also used in the web interface and needs to be escaped there.
* Return a list of all cache directories for the requestLouise Crow2014-09-01-4/+10
|
* Use request dirs method.Louise Crow2014-09-01-2/+1
|
* Use path relative to Rails root.Louise Crow2014-09-01-1/+1
|
* Move method to model to make it more testable, add spec.Louise Crow2014-09-01-0/+8
|
* Refactor state update API, better error handlinglizconlan2014-07-28-0/+10
| | | | Filters; more 403s, fewer 500s; added logging; less duplication
* Rename XXX comments with TODO:Gareth Rees2014-06-10-5/+5
| | | | Picks these up in `rake notes` and adds semantic meaning
* Merge branch 'feature/batch-requests' into rails-3-developLouise Crow2014-01-29-3/+28
|\ | | | | | | | | | | Conflicts: config/general.yml-example spec/factories.rb
| * Make method names for finding existing objects clearerLouise Crow2013-12-04-1/+1
| | | | | | | | | | They're not finding by the existing object, they're finding an existing object.
| * Simple code for the happy pathLouise Crow2013-12-04-0/+14
| | | | | | | | | | Create the batch and associate new requests with it, send the outgoing messages, and redirect to a page for the new batch.
| * Add InfoRequestBatch model.Louise Crow2013-12-04-0/+3
| | | | | | | | | | Re-annotate models. Index InfoRequestBatches by user - we'll display the batches for a user when they view their own requests.
| * Handle the application of censor rules to a batch request template.Louise Crow2013-12-04-1/+4
| |
| * Add a batch_request_template flagLouise Crow2013-12-04-1/+6
| | | | | | | | | | | | A virtual attribute to use to customise some info request behaviours when we are using one request as a template for creating multiple requests.
* | Merge branch 'feature/1176-automate-authority-contacts' into rails-3-developLouise Crow2014-01-28-0/+6
|\ \ | | | | | | | | | | | | Conflicts: doc/CHANGES.md
| * | Clean up admin indexLouise Crow2014-01-13-0/+6
| |/ | | | | | | Refactor a bit so it's easier to read.
* | Merge branch 'feature/cache-request-lists' into rails-3-developLouise Crow2014-01-28-0/+17
|\ \
| * | Cache frequently accessed request lists.Louise Crow2013-12-19-0/+17
| |/ | | | | | | Make specs a bit more focused, remove view specs - they're not relevant to the new code in their current form and don't seem to merit updating.
* / The reasons for making a report need to be translatableMark Longair2014-01-02-2/+6
|/ | | | Thanks to György Peng for pointing out this omission.
* Move getting recent requests into a helper method.Louise Crow2013-11-25-0/+48
|
* Move getting similar requests to the InfoRequest model.Louise Crow2013-11-25-0/+15
|
* Update the calculation of the numerator for percentage statisticsMark Longair2013-11-05-8/+13
| | | | | | | | | We have changed the denominator of the proportion-based statistics to only include requests that are both visible and not 'awaiting_description'. This would mean, however, that the numerator could be larger than the denominator. This commit updates the calculation of those statistics to also exclude any hidden or unclassified requests.
* Add a info_requests_visible_classified_count column to PublicBodyMark Longair2013-11-05-0/+4
| | | | | | 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).
* Move special case to whatdotheyknow-themeLouise Crow2013-10-04-8/+2
| | | | | Apart from anything else, we don't want translators to have to worry about the special case text. See https://github.com/mysociety/whatdotheyknow-theme/commit/2078febca5181ce3b1a9c0fae0123ae5f6448718 for the corresponding change to whatdotheyknow-theme.
* Merge branch 'hotfix/0.13.0.3' into rails-3-developLouise Crow2013-09-18-1/+11
|\
| * Restrict old_unclassified methods to normal prominence.0.13.0.3hotfix/0.13.0.3Louise Crow2013-09-18-1/+11
| | | | | | | | Fixes #1082.
* | Merge branch 'feature/hide-individual-responses' into rails-3-developLouise Crow2013-09-17-43/+90
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Exclude hidden responses when calculating old_unclassifiedLouise Crow2013-09-16-4/+14
| | | | | | | | | | | | | | | Make old_unclassified_params method consistent with last_public_response_event and associated methods.
| * | Only include public messages in who_can_followup_toLouise Crow2013-09-16-0/+2
| | |
| * | Add public criteria for message event access methodsLouise Crow2013-09-16-16/+18
| | | | | | | | | | | | | | | | | | | | | get_last_response_event and get_last_outgoing_event are used in various places to determine which events to link to, use in queries etc. Restrict them to refer to the last publicly visible event of the relevant type, and rename them to make that clear.
| * | Hide hidden outgoing messages in download.Louise Crow2013-09-16-1/+3
| | |
| * | Move some download methods to InfoRequest.Louise Crow2013-09-16-0/+34
| | | | | | | | | | | | | | | | | | Use send_file to send zips. Also adds 'all_can_view_all_correspondence?' - is this request completely cachable, or do we need to cache different versions for different levels of privilege?
| * | Extract calculation of last update hashLouise Crow2013-09-16-0/+4
| | |
| * | Refactor common logic about prominence and access.Louise Crow2013-09-16-7/+1
| | | | | | | | | | | | Move it into the Ability module.
| * | Rename method to make it a bit more genericLouise Crow2013-09-16-3/+3
| | | | | | | | | | | | A super user will be able to see all hidden things, not just requests.
| * | Re-annotate models with database fieldsLouise Crow2013-09-16-16/+15
| | |
* | | Allow a unicode-only title in validationLouise Crow2013-09-17-1/+5
| | |
* | | Save cached columns once updated.Louise Crow2013-09-05-0/+6
| | |
* | | Improve calculation of PublicBody statistics columnsMark Longair2013-08-20-0/+11
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On PublicBody, we don't need to update info_requests_count because that's already done with :counter_cache. On the other hand, info_requests_successful_count and info_requests_not_held_count can't be updated easily with counter_cache (since they need conditions to be attached). Instead we update them in post_save and post_destroy, as suggested here: http://blog.douglasfshearer.com/post/17495285851/custom-counter-cache-with-conditions This also adds tests to ensure that the after_(save|destroy) callbacks are called and that they modify the counts correctly.
* | Comments on described_state and calculated_stateLouise Crow2013-08-15-3/+20
| | | | | | | | | | | | Add some notes on the logic and expectations around InfoRequest.described_state and calculate_status and InfoRequestEvent.described_state and calculated_state.