Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9eda945

Browse files
authored
AO3-5871 Rename creators method in Works model (#5486)
* Initial commitChanged mention in work indexerChanged mention in share helper(?)Changed mention in specReverted previous changeReplaced two other method namesThe ones in series and external_work served the same purposeUpdated work search formRevert "Updated work search form"This reverts commit482348f.Attempt to fixRevert "Attempt to fix"This reverts commit3f4eacd.Another attempt at fixingRevert "Another attempt at fixing"This reverts commitafa835c.Maybe this'll work?Make it not add the creator field if emptyAnother approachNow this should workI did it?Guess it didn't like that comment huhRe added comment for clarity* Reverted mapping change through merge* Adressed Rubocop
1 parent02c4a2e commit9eda945

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

‎app/helpers/share_helper.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_tweet_text(work)
2121
defget_tweet_text_for_bookmark(bookmark)
2222
returnunlessbookmark.bookmarkable.is_a?(Work)
2323

24-
names=bookmark.bookmarkable.creators.to_sentence
24+
names=text_byline(bookmark.bookmarkable)
2525
fandoms=short_fandom_string(bookmark.bookmarkable)
2626
"Bookmark of#{bookmark.bookmarkable.title} by#{names} -#{fandoms}".truncate(83)
2727
end

‎app/models/external_work.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ def bookmarkable_json
9797
methods:[
9898
:posted,:restricted,:tag,:filter_ids,:rating_ids,
9999
:archive_warning_ids,:category_ids,:fandom_ids,:character_ids,
100-
:relationship_ids,:freeform_ids,:creators,:revised_at
100+
:relationship_ids,:freeform_ids,:revised_at
101101
]
102102
).merge(
103+
creators:indexed_creators,
103104
language_id:language&.short,
104105
bookmarkable_type:"ExternalWork",
105106
bookmarkable_join:{name:"bookmarkable"}
@@ -116,7 +117,7 @@ def restricted
116117
end
117118
alias_method:restricted?,:restricted
118119

119-
defcreators
120+
defindexed_creators
120121
[author]
121122
end
122123

‎app/models/search/work_indexer.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ def document(object)
9898
:comments_count,
9999
:kudos_count,
100100
:bookmarks_count,
101-
:creators,
102101
:crossover,
103102
:otp,
104103
:work_types,
105104
:nonfiction
106105
]
107106
).merge(
107+
creators:object.indexed_creators,
108108
language_id:object.language&.short,
109109
series:series_data(object),
110110
creator_join:{name::work}

‎app/models/series.rb‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@ def bookmarkable_json
235235
methods:[
236236
:revised_at,:posted,:tag,:filter_ids,:rating_ids,
237237
:archive_warning_ids,:category_ids,:fandom_ids,:character_ids,
238-
:relationship_ids,:freeform_ids,:creators,
239-
:word_count,:work_types]
238+
:relationship_ids,:freeform_ids,:word_count,:work_types
239+
]
240240
).merge(
241241
language_id:language&.short,
242242
anonymous:anonymous?,
243+
creators:indexed_creators,
243244
unrevealed:unrevealed?,
244245
pseud_ids:anonymous? ||unrevealed? ?nil :pseud_ids,
245246
user_ids:anonymous? ||unrevealed? ?nil :user_ids,
@@ -302,7 +303,7 @@ def freeform_ids
302303
filters_for_facets.select{ |t|t.type.to_s =='Freeform'}.map{ |t|t.id}
303304
end
304305

305-
defcreators
306+
defindexed_creators
306307
anonymous? ?['Anonymous'] :pseuds.map(&:byline)
307308
end
308309

‎app/models/work.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,11 +1205,12 @@ def bookmarkable_json
12051205
methods:[
12061206
:tag,:filter_ids,:rating_ids,:archive_warning_ids,:category_ids,
12071207
:fandom_ids,:character_ids,:relationship_ids,:freeform_ids,
1208-
:creators,:collection_ids,:work_types
1208+
:collection_ids,:work_types
12091209
]
12101210
).merge(
12111211
language_id:language&.short,
12121212
anonymous:anonymous?,
1213+
creators:indexed_creators,
12131214
unrevealed:unrevealed?,
12141215
pseud_ids:anonymous? ||unrevealed? ?nil :pseud_ids,
12151216
user_ids:anonymous? ||unrevealed? ?nil :user_ids,
@@ -1229,7 +1230,7 @@ def hits
12291230
stat_counter&.hit_count
12301231
end
12311232

1232-
defcreators
1233+
defindexed_creators
12331234
ifanonymous?
12341235
["Anonymous"]
12351236
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp