Commit Graph

296 Commits

Author SHA1 Message Date
evazion
115ed16a96 pools: store post_ids as array instead of string (fix #3979) 2018-11-08 15:09:31 -06:00
r888888888
192ac128cd add additional meta tags for seo 2018-10-20 17:15:29 -07:00
evazion
4a84ec9e26 artist urls: add trigram indexes on urls. 2018-09-15 19:58:55 -05:00
Albert Yi
7c6ef9f22c Revert "Revert "add prefix index on tags (#3858)""
This reverts commit 6210c1554c.
2018-09-13 11:44:07 -07:00
Albert Yi
6210c1554c Revert "add prefix index on tags (#3858)"
This reverts commit 8c564f055f.
2018-09-12 16:41:52 -07:00
Albert Yi
8c564f055f add prefix index on tags (#3858) 2018-09-12 14:01:21 -07:00
Albert Yi
762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
r888888888
334d8b7c6f Add alt_source field on uploads to deal with twitter galleries 2018-08-04 16:32:15 -07:00
Albert Yi
fcd80b6043 Artist urls can be prepended with a '-' to mark is inactive (#3388) 2018-05-16 16:04:05 -07:00
Albert Yi
b0a3f574ed fixes #3574 2018-04-25 14:31:11 -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
3657cacd17 * post keeper is calculated synchronously
* add fallback mechanism in case archive service is not up
* pass along most recently added tags to any keeper calculation
2018-03-08 16:00:44 -08:00
BrokenEagle
3c45273694 Add category for mod actions 2018-01-13 20:55:52 -08:00
evazion
89b523bdae Fix #3480: NoMethodError error when adding artist tag to post. 2017-12-30 16:07:52 -06:00
Albert Yi
7af5b133c4 Merge branch 'master' into feat-public-favgroups 2017-12-19 15:42:56 -08:00
BrokenEagle
5a602c60eb Added option to make favorite groups public 2017-12-18 17:30:02 -08:00
evazion
eede2f0752 Fix #3324: Incorporate replacement comment info in the replacement history. 2017-12-18 18:02:43 -06:00
evazion
dd8e3bbb94 tags: add trigram index on tag names. 2017-11-27 15:21:19 -06:00
BrokenEagle
7cb45fc8d3 Added fifth tag category meta 2017-11-07 10:58:42 -08:00
r888888888
c2029b62b5 delayedjob fixes 2017-10-10 15:49:34 -07:00
r888888888
b944b642b8 akismet integration 2017-09-14 13:37:36 -07:00
evazion
f3b0a0a9e9 Remove unused KeyValue model (#3206). 2017-07-09 14:30:44 -05:00
evazion
1aafdc3928 commentaries: migrate columns to non-null. 2017-06-13 16:42:29 -05:00
Type-kun
6947f39136 Synchronize db/structure.sql with migrations (missed in #3006) 2017-06-11 19:17:51 +05:00
evazion
ec9a3e5c17 posts: add partial indexes on is_pending, is_flagged. 2017-06-08 00:00:38 -05:00
evazion
8f98e8e03c posts: redefine source column to be non-NULL (fixes #3090). 2017-05-26 13:54:17 -05:00
evazion
fad4d48b1c search: fix order:note, order:comment_bumped to use indexes. 2017-05-19 18:19:05 -05:00
evazion
a8c1b0bc62 structure.sql: add forum topics (is_sticky, updated_at) index. 2017-05-19 18:19:04 -05:00
r888888888
78b08d8394 add new model for post replacements, add undo functionality 2017-05-12 17:11:40 -07:00
evazion
b48671f59f saved searches: drop unused name and category columns. 2017-04-28 17:22:25 -05:00
r888888888
b053a2d783 add source + rewrite strategy for pawoo 2017-04-20 15:50:22 -07:00
evazion
9816676bfd structure.sql: remove bank_balances, bank_transactions. 2017-04-19 17:08:28 -05:00
evazion
fb0a8e8600 db: add reason index on post_flags, post_appeals. 2017-04-16 21:15:23 -05:00
evazion
cf9b67efb7 db/structure.sql: add index_pools_on_name_trgm migration. 2017-04-16 21:15:23 -05:00
r888888888
76b5031bbf add uniqueness constraint on user names 2017-04-13 18:04:06 -07:00
r888888888
db4fa8c7da support dynamic updates of forum for bulk update requests 2017-04-12 17:09:09 -07:00
r888888888
19b8d41d09 refactor forum notifications for tag changes 2017-04-12 16:43:15 -07:00
evazion
fcc5521f63 db: add updated_at index on wiki pages.
The wiki pages sidebar is ordered by updated_at. The sidebar is present
on all wiki pages, so this improves load times for all wikis.
2017-04-07 18:10:26 -05:00
r888888888
7e40f9363d fixes #2939: <code> Blocks Need CSS Styling 2017-03-27 16:00:43 -07:00
evazion
246eb1e8ab db: add created_at indexes on post_appeals, artist/note/wiki_page versions,
This optimizes queries on /moderator/dashboard that filter by creation date.
2017-03-23 04:05:06 -05:00
r888888888
998a6494ed drop post versions table 2017-03-16 15:56:42 -07:00
r888888888
da06bee0ab revamp saved search implementation 2017-03-15 15:36:48 -07:00
evazion
02122343c3 dmails: don't default IP addr to 127.0.0.1 in database (fixes #2908).
Bug introduced in 1400f64; that commit changed dmails so that
creator_ip_addr defaulted to CurrentUser.ip_addr like this:

    after_initialize :initialize_attributes, if: :new_record?

    def initialize_attributes
      self.from_id ||= CurrentUser.id
      self.creator_ip_addr ||= CurrentUser.ip_addr
    end

...but creator_ip_addr already defaulted to 127.0.0.1 from the database,
so the ||= assignment didn't work. Remove the database default so we
always default to CurrentUser.ip_addr.
2017-03-01 19:51:48 -06:00
evazion
d9349704c7 dmails: add indexes on is_read and is_deleted (fix #2886). 2017-02-18 05:54:40 -06:00
r888888888
bfa56a860c fixes #2415: "Random post" causes RecordNotFound exceptions 2017-01-18 14:12:12 -08:00
evazion
26c193dfb3 Change post_appeals.creator_ip_addr from integer to inet.
The existing values are garbage, rails stored e.g. "87.126.98.245" as
"87.126.98.245".to_i => 87. The column is nulled to indicate these IPs
are unknown.
2017-01-12 09:28:21 +00:00
evazion
3ca638bc92 Add IP addr indexes on comments & artist/artcomm/wikipage versions. 2017-01-12 09:28:21 +00:00
Albert Yi
f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Albert Yi
c0ae6e8631 drop pool versions table 2016-12-28 16:12:24 -08:00
r888888888
2584646017 add additional formatting for delayed job listing 2016-12-24 18:00:40 -08:00