aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
...
| * | | | | Remove apparently unused action for showing random requestMatthew Landauer2013-03-22-19/+0
| | |/ / / | |/| | |
* | | | | Merge branch 'feature/new-string-for-translation' into rails-3-developLouise Crow2013-05-30-7/+15
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Allow the default text of an internal review request to be translated.Louise Crow2013-05-07-7/+15
| | | | |
* | | | | When extracting attachments for an incoming message and getting the body of ↵Louise Crow2013-05-29-7/+16
| | | | | | | | | | | | | | | | | | | | the main part in order to look for uuencoded text, make sure that we're getting that main part from the reparsed attachments, and not getting an obsolete attachment. Fixes #958.
* | | | | Check that display_filename matches URL part number or fallbackMark Longair2013-05-24-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the display_filename of the attachment found from the URL part number doesn't match the passed in display_filename then the email may have been reparsed, causing a reordering. In that case, look to see if there is another attachment that uniquely matches that filename, and, if so, return that other attachment. If no matching uniquely matching filename is found, redirect to the incoming message, rather than returning a 404.
* | | | | Refactor IncomingMessage.get_attachment_by_url_part_numberMark Longair2013-05-24-6/+1
| | | | |
* | | | | Move the mapi requires to where they're really neededMark Longair2013-05-22-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling of outlook-packed attachments would fail from rake tasks or in the console without requiring 'mapi/msg' and 'mapi/convert' beforehand. Instead, require them in the source file where they're actually used.
* | | | | Avoid an FoiAttachment validation failure under Rails 3Mark Longair2013-05-16-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under Rails 3, the uudecoded FoiAttachment in this test fails validation at the self.save! in IncomingMessage.parse_raw_email, although the FoiAttachment has been correctly created and saved to the database in _uudecode_and_save_attachments. Forcing a reload=true on self.foi_attachments fixes this. Thanks to Louise Crow for finding the fix for this problem.
* | | | | Move "require 'alaveteli_file_types'" into the initializerMark Longair2013-05-16-1/+0
| | | | |
* | | | | Make efforts to ensure that we're usually dealing with UTF-8 stringsMark Longair2013-05-16-1/+6
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of these changes is to make sure that the Mail backend, like the TMail backend it replaces, will return text parts encoded in UTF-8 if possible. The other change is to ensure that when text attachments are reloaded from disk, we attempt to convert them to UTF-8.
* | | | Mark ban text as html safeLouise Crow2013-04-25-1/+1
| | | |
* | | | Merge branch 'release/0.9' into rails-3-developLouise Crow2013-04-24-2/+13
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile.lock app/controllers/public_body_controller.rb app/mailers/track_mailer.rb app/views/request/_hidden_correspondence.html.erb app/views/request/_sidebar.html.erb app/views/request/hidden.html.erb app/views/request/new_please_describe.html.erb app/views/request/preview.html.erb app/views/user/show.html.erb config/environment.rb config/routes.rb spec/controllers/public_body_controller_spec.rb
| * | Restore call to N_Louise Crow2013-04-23-1/+1
| | |
| * | Fix the deadlock on dealing with incoming emailMark Longair2013-04-18-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #336 There was an occasional deadlock when two emails for the same request came in near-simultaneously; two processes would be started via script/mailin, each to deal with one email which are both updating the same InfoRequest. The error would look like: 2013-04-07 09:19:03 BST [13398]: [2-1] DETAIL: Process 13398 waits for ShareLock on transaction 36193647; blocked by process 13397. Process 13397 waits for ExclusiveLock on tuple (390,35) of relation 32918788 of database 32918687; blocked by process 13398. Process 13398: UPDATE "info_requests" SET "updated_at" = '2013-04-07 08:19:02.139515', "awaiting_description" = 't' WHERE "id" = 156200 Process 13397: UPDATE "info_requests" SET "updated_at" = '2013-04-07 08:19:02.143624', "awaiting_description" = 't' WHERE "id" = 156200 This arose from the following section of code: ActiveRecord::Base.transaction do raw_email = RawEmail.new incoming_message.raw_email = raw_email incoming_message.info_request = self incoming_message.save! raw_email.data = raw_email_data raw_email.save! self.awaiting_description = true params = { :incoming_message_id => incoming_message.id } if !rejected_reason.empty? params[:rejected_reason] = rejected_reason.to_str end self.log_event("response", params) self.save! end Matthew Somerville explained what was happening here in the issue report; to repeat his explanation from the bug report, both processes enter the transaction block and acquire a ShareLock on self with: incoming_message.info_request = self incoming_message.save! However, in order to update the self.awaiting_description field of the InfoRequest, with: self.awaiting_description = true [...] self.save! ... the ShareLock needs to be upgraded to an ExclusiveLock, but both will wait until the other's ShareLock is released, which would only happen at the end of the transaction. We can avoid this deadlock by using SELECT ... FOR UPDATE for the row in info_requests. In Rails 3.2.0 there is ActiveRecord support for this (via with_lock and lock! on a model instance) but so as not to require upgrading rails, I'm just using raw SQL.
| * | Update outgoing message signoff translationLouise Crow2013-04-16-1/+1
| | |
| * | Merge branch 'feature/final-consistent-translation-interpolation' into developLouise Crow2013-04-16-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/models/outgoing_message.rb app/views/general/search.rhtml app/views/public_body/list.rhtml app/views/public_body/show.rhtml app/views/public_body/view_email.rhtml app/views/request/_after_actions.rhtml app/views/request/_followup.rhtml app/views/request/_sidebar.rhtml app/views/request/new.rhtml app/views/request/select_authority.rhtml app/views/request/upload_response.rhtml locale/aln/app.po locale/app.pot locale/ar/app.po locale/bs/app.po locale/ca/app.po locale/cs/app.po locale/cy/app.po locale/de/app.po locale/en/app.po locale/en_IE/app.po locale/es/app.po locale/eu/app.po locale/fr/app.po locale/gl/app.po locale/hu_HU/app.po locale/id/app.po locale/nb_NO/app.po locale/pt_BR/app.po locale/ro_RO/app.po locale/sl/app.po locale/sq/app.po locale/sr@latin/app.po locale/tr/app.po locale/uk/app.po
| | * | In translation strings replace %{} with {{}} formattingMatthew Landauer2013-04-15-1/+1
| | | |
| | * | In translation strings replace %{} with {{}} formattingMatthew Landauer2013-04-09-1/+1
| | | |
| * | | As much as possible use I18n.locale for getting the localeMatthew Landauer2013-04-02-2/+2
| | | |
| * | | Small refactorMatthew Landauer2013-04-02-6/+1
| | | |
| * | | Refactor using I18.with_localeMatthew Landauer2013-04-02-4/+3
| | | |
| * | | Set locale with I18n rather than through globalizeMatthew Landauer2013-04-02-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Conflicts: app/controllers/general_controller.rb
| * | | Small refactoring in PublicBody.self.find_by_url_name_with_historic just use ↵Matthew Landauer2013-04-02-22/+19
| | | | | | | | | | | | | | | | the current locale
| * | | Set locale in controller test by passing parameter in getMatthew Landauer2013-04-02-1/+1
| | | | | | | | | | | | | | | | Also using I18n.locale to pass the current locale around.
* | | | Remove cvs tagMatthew Landauer2013-03-26-2/+0
| | | |
* | | | Change email address in header of source code to hello@mysociety.orgMatthew Landauer2013-03-26-19/+19
| |_|/ |/| |
* | | Replace use of Iconv in Ruby 1.9 to get rid of deprecation warningsHenare Degan2013-03-16-7/+23
| | |
* | | Fix up some merge action from f60ada47d4e7aabe0dce152109cb0d91865929daHenare Degan2013-03-15-1/+1
| | |
* | | Merge remote-tracking branch 'mysociety/develop' into rails-3-developHenare Degan2013-03-14-93/+102
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Gemfile Gemfile.lock app/controllers/admin_request_controller.rb app/controllers/admin_track_controller.rb app/controllers/request_controller.rb app/controllers/services_controller.rb app/helpers/link_to_helper.rb app/mailers/request_mailer.rb app/models/application_mailer.rb app/models/info_request.rb app/views/admin_censor_rule/edit.html.erb app/views/admin_censor_rule/new.html.erb app/views/admin_public_body/_form.html.erb app/views/admin_public_body/_locale_selector.html.erb app/views/admin_public_body/_one_list.html.erb app/views/admin_public_body/edit.html.erb app/views/admin_public_body/list.html.erb app/views/admin_public_body/new.html.erb app/views/admin_request/_incoming_message_actions.html.erb app/views/admin_request/edit.html.erb app/views/admin_request/edit_comment.html.erb app/views/admin_request/edit_outgoing.html.erb app/views/admin_request/list.html.erb app/views/admin_request/list_old_unclassified.html.erb app/views/admin_request/show.html.erb app/views/admin_track/_some_tracks.html.erb app/views/admin_track/list.html.erb app/views/admin_user/edit.html.erb app/views/admin_user/list.html.erb app/views/admin_user/show.html.erb app/views/general/_footer.html.erb app/views/general/exception_caught.html.erb app/views/help/contact.html.erb app/views/layouts/default.html.erb app/views/public_body/_alphabet.html.erb app/views/request/_request_listing_single.html.erb app/views/request/_sidebar.html.erb app/views/request/new.html.erb app/views/request/show.html.erb app/views/request_mailer/external_response.rhtml app/views/request_mailer/fake_response.rhtml config/environment.rb config/environments/production.rb config/routes.rb spec/controllers/admin_censor_rule_controller_spec.rb spec/controllers/request_controller_spec.rb spec/controllers/track_controller_spec.rb spec/helpers/link_to_helper_spec.rb spec/mailers/request_mailer_spec.rb spec/models/info_request_spec.rb spec/spec_helper.rb spec/views/public_body/show.html.erb_spec.rb spec/views/request/show.html.erb_spec.rb vendor/plugins/rails_xss/lib/rails_xss/erubis.rb
| * | Merge remote-tracking branch ↵Louise Crow2013-03-13-112/+79
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'openaustralia_github/one_support_email_on_admin_attention_state' into develop Conflicts: Gemfile.lock app/controllers/request_controller.rb app/models/request_mailer.rb app/views/admin_general/index.rhtml spec/models/request_mailer_spec.rb
| | * | Refactor functionality from controller to modelMatthew Landauer2013-03-04-0/+15
| | | |
| | * | When setting a state optionally pass a messsageMatthew Landauer2013-03-02-2/+2
| | | |
| | * | Add optional message to requires_admin emailMatthew Landauer2013-03-02-2/+2
| | | |
| | * | Avoid using return in the middle of methodsMatthew Landauer2013-03-02-7/+8
| | | |
| | * | Simplify method by using array to store mappingMatthew Landauer2013-03-02-39/+24
| | | |
| | * | InfoRequestEvent should know about its event typesMatthew Landauer2013-03-02-2/+10
| | | |
| | * | Simplify methodsMatthew Landauer2013-03-02-8/+3
| | | |
| | * | Extract methodMatthew Landauer2013-03-02-6/+5
| | | |
| | * | Simplify methodsMatthew Landauer2013-03-02-19/+7
| | | |
| | * | Simplify logic in methodMatthew Landauer2013-03-02-7/+2
| | | |
| | * | Inline methodMatthew Landauer2013-03-02-11/+1
| | | |
| | * | Inline methodMatthew Landauer2013-03-02-6/+1
| | | |
| | * | Small refactor.Matthew Landauer2013-03-02-5/+1
| | | |
| * | | Make view as html display as html5Matthew Landauer2013-03-07-2/+1
| | | |
| * | | Merge remote-tracking branch 'openaustralia_github/make-links-relative' into ↵Louise Crow2013-03-06-8/+10
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | develop Conflicts: app/controllers/admin_request_controller.rb app/models/request_mailer.rb app/views/admin_general/index.rhtml app/views/admin_general/stats.rhtml app/views/admin_public_body/_one_list.rhtml app/views/admin_public_body/_tags.rhtml app/views/admin_public_body/show.rhtml app/views/admin_request/show.rhtml app/views/admin_user/show.rhtml app/views/layouts/admin.rhtml app/views/public_body/show.rhtml app/views/request/new.rhtml
| | * | | Inline helperMatthew Landauer2013-02-15-1/+1
| | | | |
| | * | | Stop using main_url to generate absolute urls for the main siteMatthew Landauer2013-02-15-7/+7
| | | | |
| | * | | Rename helper methodMatthew Landauer2013-02-15-3/+3
| | | | |
| | * | | Rename helper methodMatthew Landauer2013-02-15-1/+1
| | | | |
| | * | | Make tracking links relativeMatthew Landauer2013-02-13-0/+2
| | | | |