Tom Hughes
b5f06e06c1
Fix rubocop Rails/TimeZone warnings
2022-03-01 22:55:10 +00:00
Andy Allan
619ac4c5b2
Enable active_record.belongs_to_required_by_default
...
This switches the logic so that belongs_to parent objects must exist
by default, and marks the optional ones explicitly. This is reflected
in the null/not_null status on the relevant db columns.
2022-02-23 20:33:28 +00:00
Tom Hughes
39b60219fe
Fix new rubocop warnings
2020-06-11 19:21:41 +01:00
Tom Hughes
7b0d3aaf9f
Fix translation names
2020-01-09 11:00:46 +00:00
Tom Hughes
b1e1572af3
Don't validate the revoker for a block if it hasn't changed
...
The revoker only has to be a moderator at the time they make the
revocation - as things stood trying to view a block that had been
revoked by somebody that was no longer a moderator failed.
2020-01-09 10:59:34 +00:00
Andy Allan
a41d500b9f
Create an ApplicationRecord for models to inherit from
...
This is the default for Rails 5+, and also paves the way for
multiple database support.
2019-11-27 11:50:48 +01:00
Andy Allan
4377e2bd55
Update annotations to correctly show bigint types
2019-05-29 11:52:20 +02:00
Andy Allan
d102c9aaf4
Move all settings to settings.yml
...
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Tom Hughes
d73a5d4bc0
Merge character validators
2018-11-05 18:54:19 +00:00
J Guthrie
1e57189366
Added tests for validators
2018-11-05 16:23:30 +00:00
J Guthrie
c2f23fea6a
Create invalid_char validators and apply to models
2018-11-05 14:27:03 +00:00
Tom Hughes
1f2ac59d1d
Fix new rubocop warnings
2018-03-26 19:00:03 +01:00
Andy Allan
b2a8df0bd7
Add annotate gem and associated rake task. Annotate models.
2017-10-22 22:18:26 +01:00
Simon Poole
7f05783949
Make test for a "zero hour" block more robust
2017-02-18 17:05:36 +01:00
Simon Poole
823f6b4d36
Add functionality to return a specific message for zero hour blocks
2017-02-18 13:53:21 +01:00
Tom Hughes
dbe165bbb3
Fix some rubocop rails style issues
2015-02-26 00:12:54 +00:00
Tom Hughes
dc2a2c8ebd
Standardise on double quoted strings
2015-02-20 19:47:26 +00:00
Tom Hughes
ef7f3d800c
Fix most auto-correctable rubocop issues
2015-02-20 08:56:16 +00:00
Tom Hughes
8fa9763281
Set default formats in the database now that rails handles enums
...
Because rails now reads the defaults from the database correctly it
no longer works to set them conditionally in after_initialise as they
have already been set.
2015-01-11 12:54:16 +00:00
Tom Hughes
f0feca800d
Replace attr_accessible with strong parameters
2013-09-21 11:35:46 +01:00
Tom Hughes
fbabed694b
Improve blocks on/by links on user pages
...
All block related links are now only shown if the user has given
or received any blocks, and include a count of active blocks.
2012-08-10 08:27:37 +01:00
Tom Hughes
aa4205482a
Treat all newly entered blocks of text as Markdown
2012-03-17 16:36:55 +00:00
Tom Hughes
1340fca8f1
Turn on mass assignment protection
...
Require any attribute that is going to be mass assigned to be
whitelisted, and whitelist those attributes which need it
2012-03-06 08:54:45 +00:00
Tom Hughes
3d55db46ed
Avoid use of deprecated methods on error objects
2011-11-14 09:42:45 +00:00
Tom Hughes
f07819d81a
Rework application configuration
...
Use a preinitializer to load the settings from application.yml so
that they are available as early as possible. All settings can also
be overridden using environment variables.
The ad-hoc settins in environment.rb are then moved to this new
system so we have one consistent location for settings.
2010-08-04 22:06:05 +01:00
Matt Amos
95c3d640a4
Tried to DRY the user_blocks controller. Moved the configuration of the blocking periods into application.yml.
2009-09-30 15:44:29 +00:00
Matt Amos
ca06b3c7b1
New migration to add better auditing to user_roles and better column names there and on user_blocks. Added a helper for displaying block status messages.
2009-09-29 16:44:03 +00:00
Matt Amos
daa2496024
First version of blocking feature. Allows both time-based (for map protection) and notice-based (for education) blocks on users. Also introduces user roles and a simple UI for displaying and administering these.
2009-09-28 16:01:00 +00:00