aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
* Try to avoid n+1 queries, and multiple admin authority queries.0.20.0.1hotfix/0.20.0.1Louise Crow2014-12-18-2/+3
| | | | Attempting to make the import faster when there are lots of public authorities in the database already
* Don't translate validation messages for models created/edited in admin interfacerelease/0.20Louise Crow2014-12-02-8/+8
|
* Fix for interpolation bug introduced in ↵Louise Crow2014-12-01-1/+11
| | | | | | | 7a3b462f41321034cbdd2c83707f739a442e83c6. The string with the unsubstituted variable pattern was being made available for translation, instead of the translatable version.
* Validate the presence of the description.Louise Crow2014-12-01-0/+1
| | | | It's required in [PublicBody#type_of_authority]( https://github.com/mysociety/alaveteli/blob/rails-3-develop/app/models/public_body.rb#L343-L347)
* Fix missing translation introduced in 962357cGareth Rees2014-11-12-3/+3
| | | | | 962357c tidied the translation but left the translation call (`_()`) around the variable rather than the string literal.
* Add fix for Apple Mail with attachments Gareth Rees2014-11-04-2/+4
|
* Merge branch 'code_tidying' into rails-3-developGareth Rees2014-10-29-564/+592
|\
| * Remove extra newlinesGareth Rees2014-10-29-3/+0
| |
| * Group PublicBody callbacks and macros at topGareth Rees2014-10-29-18/+21
| |
| * Extract descriptions in to TrackThing::TRACK_TYPESGareth Rees2014-10-29-20/+9
| | | | | | | | | | Makes TrackThing.track_type_description easier to understand and easier to add new track types along with a description.
| * Use where syntax for TrackThing.find_existingGareth Rees2014-10-29-2/+5
| | | | | | | | | | | | Faster (0.2ms vs 9.3ms) Shorter line length Non-deprecated syntax
| * Refactor TrackType types and mediums to constantsGareth Rees2014-10-29-12/+11
| |
| * Dynamically call params hash for TrackThing#paramsGareth Rees2014-10-29-20/+11
| | | | | | | | | | | | | | Easier to add params now; just add TRACK_TYPE_params method which returns the hash you want. Uses more idiomatic ||= instead of if @params.nil?
| * Extract hashes in TrackThing#params to methodsGareth Rees2014-10-29-113/+134
| | | | | | | | | | Use private methods to make TrackThing#params easier to read and ready for dynamic method calling based on the track_type
| * Clean TrackThingGareth Rees2014-10-29-51/+49
| | | | | | | | | | | | | | | | | | Use inline if Remove explicit return Use string interpolation Use unless instead of if ! Remove self. Use . instead of :: for class method calls
| * Use self. for TrackThing class methodsGareth Rees2014-10-29-8/+8
| |
| * Group TrackThing class methods at top of fileGareth Rees2014-10-29-35/+37
| |
| * Group TrackThing macro methodsGareth Rees2014-10-29-6/+3
| |
| * Extract UserInfoRequestSentAlert alert typesGareth Rees2014-10-29-10/+14
| | | | | | | | | | | | | | | | Extract UserInfoRequestSentAlert alert types to ALERT_TYPES constant. Useful for tests and forms (access with UserInfoRequestSentAlert::ALERT_TYPES) and gives more meaning to what the array contains
| * Clean UserGareth Rees2014-10-29-80/+80
| | | | | | | | | | | | | | | | | | Remove self. Use unless instead of if ! Use . instead of :: for class methods Remove explicit return Use each instead of for Use inline if
| * Group User class methods at top of classGareth Rees2014-10-29-105/+104
| | | | | | | | https://github.com/bbatsov/ruby-style-guide#consistent-classes
| * Group User macro methods at top of fileGareth Rees2014-10-29-12/+8
| | | | | | | | https://github.com/bbatsov/rails-style-guide#macro-style-methods
| * Move User callbacks to top of fileGareth Rees2014-10-29-2/+3
| | | | | | | | | | Really difficult to figure out what’s going on when a callback is buried halfway between a load of methods
| * Extract RawEmail inline calls to private methodsGareth Rees2014-10-29-3/+8
| | | | | | | | One less thing for #directory and #filepath to do
| * Tidy RawEmailGareth Rees2014-10-29-14/+11
| | | | | | | | | | | | | | Remove self. Use inline block Use inline unless Use unless instead of if !
| * Tidy PurgeRequestGareth Rees2014-10-29-11/+8
| | | | | | | | | | | | | | Remove explicit return Remove unneeded parentheses Remove self. Remove extra newlines
| * Tidy ProfilePhotoGareth Rees2014-10-29-28/+26
| | | | | | | | | | | | Remove self. Use inline if Line length
| * Extract after_initialize methods in PostRedirectGareth Rees2014-10-29-11/+10
| | | | | | | | Use separate methods to explicitly state what’s happening
| * Tidy PostRedirectGareth Rees2014-10-29-17/+16
| | | | | | | | | | | | | | | | Line length Remove self. Use inline if Remove explicit return use unless instead of if !
| * Move PostRedirect class methods to top of fileGareth Rees2014-10-29-20/+22
| |
| * Tidy HolidayGareth Rees2014-10-29-12/+12
| | | | | | | | | | | | Use self. for class methods Remove self. Line length
| * Tidy ContactValidatorGareth Rees2014-10-29-1/+3
| | | | | | | | | | Line Length Remove self.
| * Move Comment class method to top of fileGareth Rees2014-10-29-15/+15
| |
| * Improve Comment.find_existingGareth Rees2014-10-29-4/+7
| | | | | | | | | | Use `.where` Extract complex sql to named variable for readability and line length
| * Use more meaningful validations in CommentGareth Rees2014-10-29-3/+9
| | | | | | | | Use validation method names that describe what the validation does
| * Tidy CommentGareth Rees2014-10-29-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove self. Use each rather than for Use {} block rather than do/end Use self. rather than ClassName. for class method Indent private as much as method definitions Remove explicit return Line Length Use inline if Move callback before method definitions Use unless instead of if !
| * Extract complexity in ChangeEmailValidatorGareth Rees2014-10-29-2/+10
| | | | | | | | Add some private methods to add more semantics to conditionals
| * Remove duplication in ChangeEmailValidatorGareth Rees2014-10-29-5/+8
| |
| * Tidy ChangeEmailValidatorGareth Rees2014-10-29-9/+19
| | | | | | | | | | Line Length Remove self.
| * Clean up AboutMeValidatorGareth Rees2014-10-20-1/+1
| | | | | | | | Remove self.
* | Merge branch 'censor_rule_cleanup' into rails-3-developGareth Rees2014-10-28-34/+35
|\ \ | |/ |/|
| * Avoid use of parameter with attribute nameGareth Rees2014-10-15-6/+6
| | | | | | | | | | | | The `text` parameter in `apply_to_text!(text)` can easily be confused with the `text` attribute of a CensorRule. Renamed to avoid confusion and renamed the parameter in `apply_to_binary!` for consistency.
| * Privatise uncalled CensorRule methodsGareth Rees2014-10-15-20/+20
| | | | | | | | Make public api as slim as possible
| * Extract duplication in CensorRuleGareth Rees2014-10-15-2/+6
| |
| * Clean up CensorRuleGareth Rees2014-10-15-22/+19
| | | | | | | | | | | | | | | | | | | | | | - Avoid self when not required https://github.com/bbatsov/ruby-style-guide#no-self-unless-required - Pad hashes - Line length - Omit paentheses for method calls with no arguments https://github.com/bbatsov/ruby-style-guide#no-args-no-parens - Avoid return where not required https://github.com/bbatsov/ruby-style-guide#no-explicit-return
* | Merge branch 'issues/1778-send-message' into rails-3-developGareth Rees2014-10-17-37/+41
|\ \ | |/ |/|
| * Remove now-unused OutgoingMessage#send_messageGareth Rees2014-10-17-44/+0
| | | | | | | | Models should not send emails
| * Extract resending a message from the modelGareth Rees2014-10-17-3/+3
| |
| * Use updated method for sending an InfoRequestBatchGareth Rees2014-10-17-1/+7
| | | | | | | | | | Could do with extracting the sending from the model, but this allows the removal of OutgoingMessage#send_message
| * OutgoingMessage methods for async email sendingGareth Rees2014-10-14-0/+42
| | | | | | | | | | | | | | | | | | #sendable? checks whether the message is in a state that we can send, otherwise it raises an appropriate exception. Not ideal (should just return false, but this is existing behaviour) #record_email_delivery updates the OutgoingMessage instance, logs an event with the InfoRequest and updates the InfoRequest state.