Commit Graph

124 Commits

Author SHA1 Message Date
Albert Yi
79ea6f7e6c Add Docker and Travis config files to enable CI tests
Also fixes some Rails 6.0 deprecation warnings
2018-05-09 09:56:38 -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
BrokenEagle
d829ab3a00 Move all order logic to models
- Have a default order for each model
-- The overall default is ID DESC
- Allow for custom orderings
-- When comma-separated IDs are used
2018-01-29 11:42:53 -08:00
BrokenEagle
7c9dd80d35 Fix status:active so that it doesn't show flagged posts 2017-12-28 12:17:11 -08:00
BrokenEagle
26c168bdcd Fixed incorrect showing of favorites
- Moved all favorite checking logic to same file
2017-12-18 12:17:17 -08:00
Albert Yi
0674a03fb6 Merge pull request #3353 from BrokenEagle/feat-add-meta-tag-category
Migrated tag logic into config file and added fifth tag category meta
2017-11-13 11:44:15 -08:00
BrokenEagle
5b4ab8d80e Disallow a user from seeing flagger's name on own uploads 2017-11-08 00:37:16 -08:00
BrokenEagle
6838901aac Moved non-config tag category info to its own class 2017-11-07 16:21:29 -08:00
BrokenEagle
1e5540f3a0 Moved most of the tag category config logic to the config file
-Fixed an unused Post class method (fix_post_counts) that didn't have a parameter
2017-11-06 15:27:54 -08:00
evazion
7b96d9dcd4 Fix 'Deleted post filter' option applying to status:{any,all} (#3245).
https://danbooru.donmai.us/forum_topics/9127?page=196#forum_post_134342
2017-08-04 17:15:39 -05:00
Albert Yi
e4bc01533b Merge pull request #3245 from evazion/fix-2344
Fix #2344: Negating status metatag breaks deleted post filter.
2017-07-31 12:50:21 -07:00
evazion
1c38fbbf64 Fix #2344: Negating status metatag breaks deleted post filter. 2017-07-28 19:52:35 -05:00
evazion
fffc107d4f Add order:{tagcount,gentags,arttags,chartags,copytags} metatags. 2017-07-21 23:11:02 -05:00
evazion
df33901938 PostQueryBuilder: remove unused has_constraints attr (#3206).
This was previously used to prevent searches that contained only negated
tags. No longer used.
2017-07-07 16:08:02 -05:00
r888888888
361e98edee fix for flagger_id_neg search case where nothing is matched 2017-06-29 13:03:36 -07:00
Type-kun
bf6add5273 Add more support for negated existing metatags 2017-06-15 18:11:53 +05:00
Type-kun
1375cc5307 Added privilege check for seeing flagger usernames
Also reworked all places dealing with flagger names to use said privilege
2017-06-14 20:43:25 +05:00
Type-kun
5d4592e0e0 Add "flagger:" and "appealer:" metatags (fixes #3142) 2017-06-13 00:15:49 +05:00
evazion
8f98e8e03c posts: redefine source column to be non-NULL (fixes #3090). 2017-05-26 13:54:17 -05:00
evazion
05c6716def Fix date:, age: metatags to use the index. (fix #672). 2017-05-23 12:59:08 -05:00
evazion
fad4d48b1c search: fix order:note, order:comment_bumped to use indexes. 2017-05-19 18:19:05 -05:00
evazion
d74eda2b96 search: readd posts.id secondary sort to order: metatags. 2017-05-19 18:19:04 -05:00
evazion
b0626a9124 Add commenter:<any|none> metatags. 2017-04-26 16:51:34 -05:00
evazion
69d9cf3927 Add noter:<any|none> metatags. 2017-04-26 16:51:34 -05:00
r888888888
6842056d19 partial fix for #3000 2017-04-26 13:37:12 -07:00
r888888888
97da8f8647 deprecate tag subscriptions with warnings 2017-04-14 16:00:20 -07:00
evazion
558e4e5443 Add filetype: metatag. 2017-02-02 00:53:56 -06:00
Type-kun
8848fa2e2f Fixes #2861 2017-01-27 20:08:43 +05:00
evazion
601b439f96 Add order:comment_bumped, order:comment_bumped_asc metatags. 2017-01-21 11:10:40 +00:00
Albert Yi
62956be384 hide saved search functionality if not enabled 2016-12-21 14:53:39 -08:00
Type-kun
6241a50c31 Fix #2628 along with similar bug for notes 2016-09-19 17:51:36 +05:00
r888888888
20cd6076a1 fixes #2660: Support approver:any and approver:none metatags 2016-09-09 14:30:35 -07:00
r888888888
c10176e64d add upvote and downvote metatags 2016-09-08 17:48:50 -07:00
r888888888
278fe3ca20 increase decay rate for order:rank 2016-03-05 17:20:52 -08:00
r888888888
caf4a28b02 enable user privacy mode for displaying favorites 2016-02-22 12:18:19 -08:00
r888888888
89794a7ef2 add saved search gallery link, can only view your own saved searches, normalize saved search categories 2015-11-24 16:41:03 -08:00
r888888888
21ab11d92a add support for saved search metatag + tests 2015-11-24 12:55:18 -08:00
Toks
5bc0eea161 Allow searching by negated favgroup: metatag 2015-08-07 16:54:22 -04:00
Toks
d811aa0b8a Fix error when favgroup doesn't exist 2015-06-29 15:15:17 -04:00
Toks
04fa5596e2 Favorite groups 2015-06-23 15:25:54 -04:00
r888888888
5063e326e3 Revert "remove mpixel search, remove some unused indexes on posts"
This reverts commit 11e550c385.
2015-01-18 22:56:02 -08:00
r888888888
11e550c385 remove mpixel search, remove some unused indexes on posts 2015-01-15 17:43:10 -08:00
Toks
3194df7e85 Add more cases for normalizing pixiv source searches 2014-10-25 15:49:59 -04:00
Toks
4db0c3c0e5 fixes #2249 2014-09-24 13:11:54 -04:00
Toks
ed6ed14a79 #2217 fix ambiguous table reference 2014-08-03 16:38:05 -04:00
Toks
bc912ecd00 #2217 fix ambiguous table references 2014-07-06 15:16:52 -04:00
Toks
772003a55a fixes #2217 2014-07-06 12:03:48 -04:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
Kevin Xiwei Zheng
db5f14efd0 Fix missing ) causing some source searches to fail 2014-01-28 01:32:35 -05:00
Toks
f05cce2cc5 fixes #688 2014-01-16 19:42:17 -05:00