Commit Graph

52 Commits

Author SHA1 Message Date
Albert Yi
f2b525a6d2 Implement forum topic voting and tag change pruning (#3580) 2018-04-26 15:31:06 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
r888888888
e0ec9ed518 fix ordering of forum posts in topics 2018-02-01 16:35:47 -08:00
BrokenEagle
85f04a826a Added additional mod actions 2018-01-14 00:07:20 -08:00
evazion
1d62ea3220 /forum_topics: don't list stickies first in json/atom responses. 2017-06-04 16:14:55 -05:00
evazion
76b50c31bf /forum_topics/$id.atom: fix ordering (fix #3069). 2017-05-21 10:31:21 -05:00
Albert Yi
79484586cd Merge branch 'master' into fix-forum-topic-visits 2017-05-15 16:10:21 -07:00
evazion
71a19c28f1 forum topics: don't record a topic visit for api requests. 2017-05-13 13:50:20 -05:00
evazion
8c88e87710 /forum_topics.atom: add atom feed for forum topics. 2017-05-13 10:37:59 -05:00
Albert Yi
8db970f9f3 skip api check for forum and comment endpoints 2017-01-10 15:06:34 -08:00
Albert Yi
79842f7a3b restrict min level constraints for forum topics to mod+admin and restrict options based on current user's level. check privileges for visiblity in forum posts and topics. deprecate serializable_hash (undocumented, internal) for as_json, refactor to use hidden_attributes and method_attributes #2658 2016-10-25 15:05:55 -07:00
Albert Yi
589df5f301 implements #2658: private forum topics 2016-10-24 16:56:18 -07:00
r888888888
eb0db94ad5 increase default topic count per page on listing 2015-07-15 13:41:44 -07:00
Toks
fe7f3d8204 Keep track of who deletes forum post/topic/comment
Previously it would look like the creator of it was the one who
deleted/undeleted it, even if it was someone else.
2015-07-11 13:20:47 -04:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
Toks
7c2ce325a3 fix #2403, remove unused code 2015-06-08 17:34:13 -04:00
Toks
2ee548dc85 Fix topic merge
It was merging in the wrong direction, and didn't update response count.
2014-11-12 01:20:27 -05:00
Toks
5fd6a018cb Fix anonymous users creating visit records, which do not get used 2014-07-18 16:08:47 -04:00
r888888888
bb402f5a27 fixes #2197 2014-07-17 16:34:54 -07:00
r888888888
58a0086e69 potential fix for #2192 2014-06-12 21:41:37 -07:00
r888888888
aab03422bc performance tweaks for rails 4.1 2014-04-24 22:24:42 -07:00
Toks
168587d5cb fixes #2117 2014-03-26 13:52:09 -04:00
Toks
e28ede19dc fixes #2119 2014-03-26 13:20:22 -04:00
r888888888
de34d21f76 fixes #1289 2014-03-18 11:21:10 -07:00
r888888888
7e07b874a4 implementation for #1469
This reverts commit 18edc937fd.
2014-03-14 18:39:31 -07:00
r888888888
18edc937fd Revert "implementation for #1469"
This reverts commit 08b9b2771f.
2014-03-10 16:31:38 -07:00
r888888888
08b9b2771f implementation for #1469 2014-03-07 15:55:49 -08:00
Toks
59aa45e83b fixes #920 2013-10-09 13:05:06 -04:00
Toks
39a6cca62a fixes #1080 2013-07-07 19:29:24 -04:00
Toks
2016e15ce8 fixes #1508 2013-06-30 11:57:30 -04:00
Toks
9ccf1e0f8f add limit parameter to everything 2013-05-15 01:01:19 -04:00
albert
541dabaaf6 fixes #1108 2013-03-29 15:37:28 -04:00
albert
217e878a0f fixes #1037 2013-03-22 19:35:13 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
00934a1e13 edit link for original forum post goes to edit topic action 2013-02-25 09:39:27 -05:00
albert
2f47b01379 add action for marking forum as read 2013-02-24 17:09:07 -05:00
albert
56dd8707fd controller tweaks 2013-02-23 15:58:21 -05:00
albert
78f1d0f69a fixes to user search 2013-02-21 12:42:41 -05:00
albert
8749c43b3e refactored search 2013-01-10 17:45:52 -05:00
albert
9fb0f16f01 fixed tests 2012-03-12 18:22:44 -04:00
albert
dd5a965884 fixes 2012-03-12 17:50:45 -04:00
albert
3871188bde reverts old behavior of forum topic highlighting 2011-10-27 19:03:07 -04:00
albert
c9cb34beaf fixes #121: editing comments shifts their position 2011-10-27 18:38:24 -04:00
albert
eee3351c0f fixes #139: New forum threads submitted locked/stickied are neither. 2011-10-17 00:13:36 -04:00
albert
124403a921 implemented last-forum-read-at 2011-08-23 17:11:21 -04:00
albert
a16dfdf0dd fixes 2011-07-09 03:32:18 -04:00
albert
bd520f61f7 forum previews working 2011-03-12 16:09:11 -05:00
albert
21cc1cbafa work on forum 2011-03-11 19:24:19 -05:00
albert
523cc9fe02 work on forum post controller 2011-01-12 18:21:39 -05:00
albert
668fbab77a * Updated gemfile
* Added forum post/topic unit tests
* Added forum post/topic controller tests
2011-01-12 18:00:07 -05:00