Commit Graph

47 Commits

Author SHA1 Message Date
Donovan Daniels
0346f86ac7
[Artists] Convert is_active into proper deletion (#660) 2024-07-20 11:45:36 -07:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
40dd24f387
[Cleanup] Remove search_text_attribute
* Undocumented
* Some don't work because of strong params

Some of the possible attributes seem like they would be
useful but I would rather introduce them properly and
with more thought behind it
2023-06-01 21:45:51 +02:00
Earlopain
7a028cf003
[Tests] Set CurrentUser.ip_addr in base setup 2022-11-26 16:20:16 +01:00
Earlopain
98e55562eb
[Tests] Clean up teardowns 2022-11-26 14:02:06 +01:00
Earlopain
e0819dfd5f
[Tests] Remove as_admin helper 2022-11-26 12:37:22 +01:00
Earlopain
87313c437c [Tests] Include FactoryBot::Syntax::Methods
The newly included create method behaves exacly like the self-written one,
with the added benefit of it not appearing in backtraces.
2022-11-25 21:06:54 +01:00
Earlopain
e7b155cb85
[Cleanup] Remove where_regex
Only artist_url matching was using this.
2022-10-13 18:22:07 +02:00
Earlopain
e1e9324c84
[Tests] A few fixes 2022-09-17 19:32:21 +02:00
Earlopain
348827de5d
[Tests] Fix artist tests 2022-02-19 17:07:58 +01:00
Albert Yi
79dfa6c28f fix migration for circleci 2018-12-10 17:51:57 -08:00
evazion
03cc3dfa50 artists: fix editing invalid urls in artist entries (fix #3720, #3927, #3781)
Convert to an autosave association on urls. This ensures that when we
save the artist we only validate the added urls, not bad urls that we're
trying to remove, and that url validation errors are propagated up to
the artist object.

This also fixes invalid urls being saved in the artist history despite
validation failing (#3720).
2018-10-04 19:49:16 -05:00
evazion
d294514dc0 nijie: don't crash on invalid urls or deleted works (#3919). 2018-09-23 20:08:14 -05:00
evazion
b6228505aa nijie: fix page_url method.
The id in a bare image url is the member id, not the illust id.
2018-09-23 20:08:13 -05:00
Albert Yi
aea2d77c3a
Merge pull request #3907 from evazion/fix-3900
#3900: Allow to search for urls associated with artists using wildcards
2018-09-17 12:03:15 -07:00
evazion
325120ee51 twitter: fix parsing of the artist name from the url.
Fixes URLs like https://twitter.com/intent/user?user_id=123 being
incorrectly normalized to http://twitter.com/intent/ in artist entries.

Also fixes the artist name to be taken from the url when it can't be
obtained from the api (when the tweet is deleted).
2018-09-16 15:03:23 -05:00
evazion
c9b3c8d217 artist urls: add tests for controller + artist url search. 2018-09-15 19:58:55 -05:00
Albert Yi
f16c3a3f40 fix nijie specs 2018-09-11 13:27:00 -07:00
evazion
b924c2bb9c nijie: fix artist url normalization. 2018-09-09 13:17:52 -05:00
evazion
aee1906761 Fix #3738: Artist URL search should be case-insensitive for domains. 2018-09-05 19:14:24 -05:00
Albert Yi
4a56f8d160 fixes #3856 for pixiv fanbox urls 2018-09-04 12:53:58 -07:00
evazion
c689a161f6 pixiv: fix failure when normalizing pixiv stacc artist urls (#3856). 2018-08-30 19:24:44 -05:00
Albert Yi
48f2a79d13 fix artist url spec and bug with nicoseiga strategy not recognizing urls 2018-08-29 17:14:36 -07:00
Albert Yi
762dc3da24 Refactor sources 2018-08-24 12:10:51 -07:00
Albert Yi
135b97d511 additional fixes for deviantart artist search (#3771) 2018-07-27 12:31:26 -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
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
4a80d6c337 refactor User#validate_sock_puppet to disable for tests 2018-01-02 14:32:38 -08:00
r888888888
461ddbf017 fixes #3422 2017-12-21 11:33:23 -08:00
r888888888
502f1298a9 fix unit tests 2017-11-20 16:30:07 -08:00
evazion
eac827973b Normalize pixiv artist urls to pixiv member page (fix #3048). 2017-05-15 14:12:08 -05:00
evazion
c0e5c400a7 tests: fix tests for Rails.cache. 2017-04-16 16:48:36 -05:00
Albert Yi
0ea7d78584 remove usage of vcr cassettes; delete unused fixtures; fix some broken unit tests 2016-12-28 15:47:28 -08:00
Albert Yi
3ad639521f fixes #2805: Improve nico seiga support 2016-12-27 16:11:22 -08:00
Albert Yi
e8336afd81 fixes #2718: Twitter artist finding should not be case sensitive 2016-10-24 12:18:44 -07:00
Toks
8e17b4936a Fix artist finder for hentai foundry
#2489
2015-08-11 20:28:58 -04:00
r888888888
a9502c0dc2 fixes #2319: Artist search - NicoSeiga - not finding artist entries from partial URLs 2015-08-07 15:19:47 -07:00
r888888888
a031a4eba8 fix test 2013-05-07 13:27:21 -07:00
r888888888
ce10a72bb6 fixes #1396, fix tests 2013-05-03 17:29:41 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
d16a240eda for artist urls, normalize https 2013-02-21 16:13:06 -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
5158d1b274 fixes for upgrade schema script 2011-11-06 10:12:23 -05:00
Dean Matzkov
5efb6a5b92 Fix unit tests for ruby-1.8 compatibility 2011-09-08 21:00:29 -06:00
albert
ad39553aac updated tests, switched to rails 3.0.0rc2 2010-08-26 14:36:02 -04:00
albert
a7a6395384 added artist url test 2010-02-15 14:17:08 -05:00
albert
e9c2d1e636 added artists, comments 2010-02-15 13:59:58 -05:00