Commit Graph

31 Commits

Author SHA1 Message Date
Albert Yi
c144159dd9 fix tests 2018-05-09 14:36:03 -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
evazion
19e91f438b bans: add test for logging in with expired ban. 2017-05-07 12:13:25 -05:00
r888888888
48e9856f37 fixes #3007: Eliminate Janitor role 2017-05-01 14:38:30 -07:00
evazion
64b4004bbf tests: add favorite groups controller tests. 2017-02-06 18:48:35 -06:00
Albert Yi
b9a1e115fb add additional mod actions 2017-01-03 16:02:36 -08:00
evazion
8672604ee7 Add upvote:/downvote: editing metatags. 2016-10-26 23:23:47 -05:00
evazion
5e75dcecea Add test cases for anon/banned/member voting. 2016-10-14 04:47:51 +00:00
r888888888
6480864718 fixes #2469 2015-10-15 15:24:24 -07:00
r888888888
341b29ce41 fix tests 2015-08-18 17:40:53 -07:00
r888888888
1d9596d7f2 fixes #2417 2015-06-29 18:17:59 -07:00
r888888888
f02f72fac1 implement saved searches, move user boolean settings to bitprefs 2014-06-18 16:16:27 -07:00
r888888888
d5f575159f rename references of privileged to gold 2013-04-28 00:04:52 -07:00
albert
b19994396d fix tests, fixes #1173 2013-04-03 17:23:25 -04:00
albert
a4b67fa072 fix tests and typo bugs 2013-03-22 18:54:37 -04:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
66fc05e30b change privileged accounts to gold accounts, add platinum accounts, add favorite and tag query limiting based on level 2013-02-20 00:02:43 -05:00
albert
17881068e1 * Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3
* Fixed tests
2012-06-01 19:22:58 -04:00
albert
7269ec0076 removed small image support 2012-03-13 18:28:32 -04:00
albert
5158d1b274 fixes for upgrade schema script 2011-11-06 10:12:23 -05:00
albert
04103c3352 added invites 2011-07-29 19:42:25 -04:00
albert
04ab2f4701 fixed unit tests 2011-07-16 20:21:28 -04:00
albert
58c3d2af13 fixing tests 2011-07-16 19:20:02 -04:00
albert
502aeb6a16 added user func test 2011-02-02 15:53:28 -05:00
albert
3d5873c182 some fixes to janitor trials, implemented jan trial controller test 2011-01-14 16:45:10 -05:00
albert
e46bfb3d76 separated out ip ban logic from regular bans, users can no longer register if an ip ban is in place 2010-03-18 17:55:57 -04:00
albert
9eb578927c added limit methods to user, more work on post views 2010-03-12 15:18:30 -05:00
albert
ac98d7db37 stubbed in blank controllers/helpers/functional tests 2010-03-10 18:21:43 -05:00
albert
e6888ea1dd fixed tag and pending post tests, added category multiget helper to tag, post/unapproval/post version in progress still 2010-02-10 16:12:30 -05:00
Albert Yi
341a24e22e tag unit test 2010-02-06 23:11:26 -05:00
Albert Yi
3bfae1f0db added user test, basic user methods 2010-02-06 16:48:40 -05:00