aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
Commit message (Collapse)AuthorAgeLines
* WIP commit of public body page redesignMartin Wright2015-03-02-2/+1
|
* Merge branch 'rails-3-develop' of ↵Louise Crow2015-02-24-2/+10
|\ | | | | | | ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
| * Add User#banned?Gareth Rees2015-02-24-2/+10
| | | | | | | | | | | | | | - Redefined User#public_banned? to User#banned? - Add specs for User#banned? - Deprecate User#public_banned? - Replace use of User#public_banned? with User#banned?
* | Merge branch 'allow-custom-state-testing' into rails-3-developLouise Crow2015-02-24-5/+3
|\ \ | |/ |/|
| * 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
* | Merge branch '2134-fix-same-attribute-value-across-locales' into rails-3-developLouise Crow2015-02-23-80/+99
|\ \
| * | Refactor massive import method into smaller instance level methodsLouise Crow2015-02-23-89/+83
| | |
| * | Use standard spacing for hashes, new lines for commentsLouise Crow2015-02-23-2/+3
| | |
| * | Test localised value for import against existing localised valueLouise Crow2015-02-23-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the call to public_body.send would return the value for the default locale if no value was set in the current locale, meaning that translations for attributes that were the same as the attribute values in the default locale were not being loaded. Fixes #2134.
* | | Move logic to modelLouise Crow2015-02-20-0/+5
| | |
* | | Use correct method name in error.Louise Crow2015-02-20-1/+1
| | |
* | | Refactor common logicLouise Crow2015-02-20-15/+7
| | |
* | | Standard separation of methods.Louise Crow2015-02-20-1/+3
| |/ |/| | | | | Comment above a method should apply to that method only
* | Remove unused lineLouise Crow2015-02-09-1/+0
| |
* | Merge branch 'hotfix/0.20.0.6' into rails-3-developLouise Crow2015-02-05-3/+16
|\ \ | | | | | | | | | | | | Conflicts: spec/models/public_body_spec.rb
| * | Deprecate PublicBody#translations_attributes=(Array)Gareth Rees2015-02-03-0/+13
| | | | | | | | | | | | Array handling will no longer be supported in release 0.22
| * | Fix submission of form containing both existing and new translationsLouise Crow2015-02-03-2/+2
| | |
| * | Add specs for PublicBody#translated_versions=Gareth Rees2015-01-30-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Also fixes #empty_translation? to check for String and Symbol keys named 'locale'. Specs use a pre-change check to assert difference. For some reason rspec change matcher fails with 'nil is not a symbol'.
* | | Use each_with_index rather than magic booleanGareth Rees2015-02-04-2/+2
| | |
* | | Use map instead of creating empty arrayGareth Rees2015-02-04-3/+4
| | |
* | | Nicer capitalize first letter onlyGareth Rees2015-02-04-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String#capitalize downcases remaining letters, so: > 'heLLo WorLd'.capitalize # => "Hello world" Our version only works on the first character of the String, preserving the case of the rest of the String: > 'heLLo WorLd'.sub(/\S/) { |m| Unicode.upcase(m) } # => 'HeLLo WorLd' Also handle unicode.
* | | Use each instead of forGareth Rees2015-01-23-1/+1
| | |
* | | Remove home-grown Array#to_sentence dupGareth Rees2015-01-23-8/+4
| |/ |/| | | | | | | - to_sentence does the same job as the removed code. - Clean up the conditional with .any? and implicit returns
* | Remove duplicate method.Louise Crow2015-01-12-10/+0
| |
* | Update table attribute metadataLouise Crow2014-12-23-11/+8
| | | | | | | | | | Some fields have moved to different models, or exist in translation tables.
* | Merge branch 'brakeman_fixes' into rails-3-developLouise Crow2014-12-18-13/+10
|\ \
| * | Improve InfoRequestEvent#incoming_message_selective_columns SQLGareth Rees2014-12-18-5/+4
| | |
| * | Improve InfoRequest.find_in_state SQLGareth Rees2014-12-18-3/+3
| | |
| * | Improve User#get_undescribed_requests SQLGareth Rees2014-12-18-5/+3
| | |
* | | Merge branch 'admin-public-holiday-interface' into rails-3-developLouise Crow2014-12-18-0/+95
|\ \ \
| * | | Allow import of holidays from feed or built-in suggestionsLouise Crow2014-12-15-0/+93
| | | |
| * | | Add validation for presence of day.Louise Crow2014-12-15-0/+2
| | | |
* | | | Merge branch 'hotfix/0.20.0.1' into rails-3-developLouise Crow2014-12-18-2/+3
|\ \ \ \ | | |_|/ | |/| |
| * | | 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
* | | Refactor the application of masks and censor rules to messages.Louise Crow2014-12-15-142/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | 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