Albert Yi
72f319ccf3
rename lambda references to use shorthand syntax
2018-05-10 11:18:02 -07:00
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
evazion
c7492343ce
String: add truthy? & falsy? core extensions.
...
* Add `truthy?` and `falsy?` core extensions to String.
* Use `truthy?` and `falsy?` to replace ad-hoc parsing of boolean
parameters in various places.
2018-05-03 19:57:14 -05: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
97ce9cafac
add httparty option config
2017-07-12 15:52:48 -07:00
r888888888
eb6c5e3af5
switch to httparty
2017-07-12 15:52:48 -07:00
evazion
dc079d7932
/saved_searches/labels.json: support wildcards in search[label] param.
2017-07-11 19:21:41 -05:00
evazion
c1834ab8dd
Inherit models from ApplicationRecord instead of ActiveRecord::Base.
2017-06-16 13:28:31 -05:00
evazion
0b63dd32d1
saved searches: don't change tag ordering within queries.
...
Normalize queries aside from the tag ordering when they're saved.
Normalize queries including ordering when they're sent to listbooru.
This way tag ordering within searches is kept in the /saved_searches listing.
2017-04-28 16:24:07 -05:00
evazion
0b2493b2dd
tag subscriptions: fix broken saved search migrations.
2017-04-21 22:48:52 -05:00
evazion
25b2b399cc
saved searches: fix exception when searching for search:adfijoioi.
...
Fixes this exception:
NoMethodError exception raised
undefined method `empty?' for nil:NilClass
app/logical/post_query_builder.rb:113:in `block in add_saved_search_relation'
app/logical/post_query_builder.rb:106:in `each'
app/logical/post_query_builder.rb:106:in `add_saved_search_relation'
app/logical/post_query_builder.rb:237:in `build'
app/models/post.rb:1624:in `tag_match'
app/models/post.rb:1172:in `block in fast_count_search'
config/initializers/active_record_extensions.rb:16:in `with_timeout'
app/models/post.rb:1171:in `fast_count_search'
app/models/post.rb:1162:in `fast_count'
app/logical/post_sets/post.rb:106:in `get_post_count'
app/logical/post_sets/post.rb:122:in `posts'
app/controllers/posts_controller.rb:15:in `index'
caused by this failure in listbooru when you send it an empty array as the list of queries:
Redis::CommandError - ERR wrong number of arguments for 'zunionstore' command:
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/client.rb:121:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:1932:in `block in zunionstore'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:58:in `block in synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:58:in `synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:1931:in `zunionstore'
web/listbooru.rb:85:in `aggregate_searches'
web/listbooru.rb:104:in `block in <main>'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block incompile!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block inprocess_route'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block indispatch!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block ininvoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block ininvoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/logger.rb:15:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/commonlogger.rb:33:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:219:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:212:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/head.rb:13:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb:25:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block incall'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in `synchronize'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-1.6.5/lib/rack/handler/webrick.rb:88:in `service'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:140:in `service'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/httpserver.rb:96:in `run'
/home/admin/.rbenv/versions/2.4.1/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'
2017-04-03 15:03:26 -07:00
r888888888
70d057f8f3
move saved search option to sidebar
2017-03-20 16:19:15 -07:00
r888888888
bdeba94b31
fix error case in saved search
2017-03-16 15:17:55 -07:00
r888888888
da06bee0ab
revamp saved search implementation
2017-03-15 15:36:48 -07:00
r888888888
8a93fdf18f
additional saved search fixes
2017-01-25 12:48:47 -08:00
r888888888
c7b5a4e229
add references to user statistics page about saved searches
2017-01-23 10:56:39 -08:00
Albert Yi
62956be384
hide saved search functionality if not enabled
2016-12-21 14:53:39 -08:00
Albert Yi
deb62e0cdb
smarter updates on saved searches on tag batch changes #2674
2016-12-05 17:22:07 -08:00
Albert Yi
d7c4c1f714
fix references to https for listbooru
2016-12-02 13:28:13 -08:00
r888888888
70fef49e81
add saved search category change ui
2016-09-11 01:37:10 -07:00
r888888888
d0bbe27217
include saved searches section in user profiles
2016-08-22 14:59:43 -07:00
r888888888
1eb335474c
fix saved search method
2016-08-22 13:57:09 -07:00
r888888888
5de9adf0f5
work on saved searches embedded in user profiles
2016-08-19 17:33:42 -07:00
r888888888
e9ffa16b09
fixes #2562 : Saved Searches - undefined method
2016-01-02 23:48:52 -08:00
r888888888
3829dc6a11
further level-gate saved search updates on listbooru
2015-12-30 11:54:26 -08:00
r888888888
71c4e3f079
dont block updates if listbooru isn't enabled on saved search callbacks
2015-12-28 15:36:32 -08:00
r888888888
d5fa4b46e3
* refactor aws config options
...
* fix aws calls in savedsearch
* remove unused scripts
2015-12-28 12:26:20 -08:00
r888888888
3bffc67d5a
fixes #2558 : site map links
2015-12-09 15:47:10 -08:00
r888888888
9bcbb48c6c
add reset for savedsearch
2015-12-04 17:34:30 -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
90eb374d06
enabled saved search processing only for gold users
2015-11-24 13:11:34 -08:00
r888888888
21ab11d92a
add support for saved search metatag + tests
2015-11-24 12:55:18 -08:00
r888888888
49ba8333c0
fix saved search refresh
2015-11-23 11:12:40 -08:00
r888888888
1288889e52
add edit option for saved searches
2015-11-19 13:44:17 -08:00
r888888888
cac943e997
add code to fetch post ids from listbooru for a saved search
2015-11-11 18:04:00 -08:00
r888888888
6514265ca7
support new listbooru changes #2523
2015-11-03 16:50:52 -08:00
r888888888
98dfae2c7f
ping listbooru when scanning saved searches #2523
2015-10-27 18:02:28 -07:00
r888888888
fafb881080
remove support for listbooru for tag subscriptions, enable for saved searches #2523
2015-10-27 17:47:07 -07:00
r888888888
11512e23d3
bug fixes #2523
2015-10-23 17:03:57 -07:00
r888888888
b64c329397
hook in listbooru #2523
2015-10-23 16:50:56 -07:00
Toks
cb11f5f461
#2335 normalize for search too
2015-03-08 14:52:30 -04:00
SundaySalsa
a6233f297e
added responsive css
2015-02-26 17:59:25 -08:00
Toks
e5b6357626
#2335 normalize for search too
2015-01-30 13:43:50 -05:00
r888888888
9404052ada
fixes #2335
2015-01-19 17:14:43 -08:00
r888888888
f02f72fac1
implement saved searches, move user boolean settings to bitprefs
2014-06-18 16:16:27 -07:00