aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
...
| * | Extract calculation of last update hashLouise Crow2013-09-16-0/+4
| | |
| * | Add new code and specs for hiding attachments.Louise Crow2013-09-16-0/+4
| | |
| * | Add a possible event type 'edit_incoming'.Louise Crow2013-09-16-1/+1
| | | | | | | | | | | | This will cover changes in prominence to incoming messages.
| * | Make prominence states a constant so we can access them elsewhere.Louise Crow2013-09-16-5/+2
| | |
| * | Don't index hidden and requester_only incoming messages.Louise Crow2013-09-16-0/+8
| | |
| * | Adding prominence_reason to IncomingMessage.Louise Crow2013-09-16-0/+1
| | |
| * | Refactor common logic about prominence and access.Louise Crow2013-09-16-14/+2
| | | | | | | | | | | | Move it into the Ability module.
| * | Add a method to ask whether a user can view an incoming message.Louise Crow2013-09-16-0/+10
| | |
| * | Rename method to make it a bit more genericLouise Crow2013-09-16-5/+5
| | | | | | | | | | | | A super user will be able to see all hidden things, not just requests.
| * | Add response_event helperLouise Crow2013-09-16-0/+6
| | | | | | | | | | | | | | | Add a convenience method for getting the 'response' event associated with an incoming message.
| * | Add prominence to incoming message.Louise Crow2013-09-16-0/+7
| | |
| * | Re-annotate models with database fieldsLouise Crow2013-09-16-143/+124
| | |
| * | Remove prominence.Louise Crow2013-09-16-23/+0
| | | | | | | | | | | | | | | | | | | | | Add a migration to remove the unused column 'prominence' from info_request_events, remove validation of prominence, remove unused InfoRequestEvent.user_can_view? method. Remove references to InfoRequestEvent.prominence.
* | | Allow a unicode-only title in validationLouise Crow2013-09-17-1/+5
| | |
* | | Save cached columns once updated.Louise Crow2013-09-05-0/+6
| | |
* | | Don't dirty the first_letter attribute when not changed.Louise Crow2013-09-05-3/+14
| | |
* | | Don't re-index body when updating statsLouise Crow2013-09-05-0/+1
| | |
* | | Don't save versions of new counter cache columnsLouise Crow2013-09-05-1/+5
| | |
* | | Don't include NULL column values in the statisticsMark Longair2013-08-20-1/+1
| | | | | | | | | | | | | | | | | | | | | We were already excluding graphs where all the data was NULL but it's possible by directly manipulating the database to have some values NULL and some non-NULL, so exclude any NULL values anyway.
* | | Refactor calculation of statisticsMark Longair2013-08-20-0/+59
| | | | | | | | | | | | | | | | | | Move the calculation of statistics on public bodies into the PublicBody model, so that there's less logic in the controller.
* | | 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.
* | Make admin edits affect info_request_event described_states.Louise Crow2013-08-15-3/+4
| | | | | | | | | | | | | | Make sure that admin edits changing the described state of an info request are reflected in the latest_status and status values of info request events so that the info requests are retrieved correctly in status-based searches.
* | Allow 'edit' and 'status_update' calculated states to propagate.Louise Crow2013-08-15-4/+16
|/ | | | | | | | Update test expectations and add further test to explicitly show that we want the described status from a status update to be propagated to a preceding response, as well as being filled in in the status update itself (which is mostly to deal with the case where there isn't a preceding response). Make those changes to calculate_event_states
* Prevent erroneous internal error messages with multibyte characters under ↵Louise Crow2013-07-25-2/+2
| | | | ruby 1.8 by using mb_chars for length comparison - it counts multibyte characters.
* Merge remote-tracking branch ↵Louise Crow2013-07-23-11/+1
|\ | | | | | | | | | | | | 'openaustralia_github/tests_set_described_state' into rails-3-develop Conflicts: spec/models/info_request_spec.rb
| * Now record a state_update event *whenever* a user classifies a requestMatthew Landauer2013-04-20-10/+0
| |
| * How we would handle event states if we added a state_update event whenever a ↵Matthew Landauer2013-04-20-1/+1
| | | | | | | | user classifies a request
| * Simple solution to bugs shown up in tests in last 2 commitsMatthew Landauer2013-04-18-1/+1
| |
* | Split the string interpolation and translation into two steps so that the ↵Louise Crow2013-06-24-2/+5
| | | | | | | | translation gets picked up by rake gettext:find. Add a bit more explanation.
* | Merge branch 'hotfix/0.11.0.14' into rails-3-developLouise Crow2013-06-19-1/+1
|\ \
| * | Allow the HTML display of the body of an email to handle the case where the ↵0.11.0.14hotfix/0.11.0.14Louise Crow2013-06-19-1/+1
| | | | | | | | | | | | body is only quoted text and there is no subject.
* | | Merge branch 'hotfix/0.11.0.7' into rails-3-developLouise Crow2013-06-10-1/+1
|\| | | | | | | | | | | | | | Conflicts: spec/models/info_request_spec.rb
| * | Cope with replying to a message with a missing or empty SubjectMark Longair2013-06-07-1/+1
| | | | | | | | | | | | | | | | | | Conflicts: spec/models/info_request_spec.rb
* | | Merge branch 'hotfix/0.11.0.4' into rails-3-developLouise Crow2013-06-10-1/+3
|\| |
| * | Merge branch 'release/0.11'0.11.0.3Louise Crow2013-06-04-1174/+281
| |\ \
| * | | Return a string from user.name always to avoid any complications with other ↵hotfix/0.9.0.5Louise Crow2013-05-28-1/+3
| | | | | | | | | | | | | | | | functions calling gsub on the result. SafeBuffer won't work with gsub until Rails 3.2 https://github.com/rails/rails/commit/b4a6e2f8442ceda118367f9a61c38af754be1cbf
| * | | Bugfix for the case where a suspended user sends a contact message. Their ↵hotfix/0.9.0.2Louise Crow2013-05-07-1/+1
| | | | | | | | | | | | | | | | name (with the '(account suspended)' suffix) is marked by the translation call as HTML safe, so escapes the angled brackets when they are appended to it in the contact mailer code. Use string interpolation instead.
| * | | Mark ban text as html safeLouise Crow2013-04-29-1/+1
| | | |
* | | | Handle request for json for an external request. Closes #973.Louise Crow2013-06-07-1/+5
| | | |
* | | | Merge remote-tracking branch ↵Louise Crow2013-06-04-0/+15
|\ \ \ \ | | | | | | | | | | | | | | | 'openaustralia_github/more_info_on_report_request' into rails-3-develop
| * | | | Reasons that request can be reported now stored in modelMatthew Landauer2013-03-22-0/+6
| | | | |
| * | | | Wrap in a transactionMatthew Landauer2013-03-22-3/+5
| | | | |
| * | | | Extract methodMatthew Landauer2013-03-22-0/+7
| | | | |
* | | | | Merge remote-tracking branch ↵Louise Crow2013-06-04-26/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'openaustralia_github/inline_search_method_refactor' into rails-3-develop
| * | | | | Remove unused methodMatthew Landauer2013-03-25-11/+0
| | | | | |
| * | | | | Inline method InfoRequest.full_searchMatthew Landauer2013-03-25-15/+0
| |/ / / /
* | | | | Merge remote-tracking branch ↵Louise Crow2013-06-04-19/+4
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'openaustralia_github/small_email_hash_refactor' into rails-3-develop
| * | | | | Inline method and simplify logicMatthew Landauer2013-03-29-19/+4
| | |_|_|/ | |/| | |
* | | | | Merge remote-tracking branch ↵Louise Crow2013-05-30-19/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'openaustralia_github/remove_random_request_action' into rails-3-develop