Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

AO3-3496 Mark for Later should be immediate ( take 2 ) #2481

Merged
merged 12 commits into from Aug 10, 2016

Conversation

Projects
None yet
4 participants
Contributor

zz9pzza commented Jun 8, 2016

Replaces #2466

https://otwarchive.atlassian.net/browse/AO3-3496

I think this has the renames you wanted.

zz9pzza added some commits May 25, 2016

@@ -9,7 +9,7 @@ class WorksController < ApplicationController
before_filter :check_user_status, :except => [ :index, :show, :navigate, :search, :collected ]
before_filter :load_work, :except => [ :new, :create, :import, :index, :show_multiple, :edit_multiple, :update_multiple, :delete_multiple, :search, :drafts, :collected ]
# this only works to check ownership of a SINGLE item and only if load_work has happened beforehand
- before_filter :check_ownership, :except => [ :index, :show, :navigate, :new, :create, :import, :show_multiple, :edit_multiple, :edit_tags, :update_tags, :update_multiple, :delete_multiple, :search, :marktoread, :drafts, :collected ]
+ before_filter :check_ownership, :except => [ :index, :show, :navigate, :new, :create, :import, :show_multiple, :edit_multiple, :edit_tags, :update_tags, :update_multiple, :delete_multiple, :search, :mark_for_later, :mark_as_read, :drafts, :collected ]
@houndci-bot

houndci-bot Jun 8, 2016

Use the new Ruby 1.9 hash syntax.
Space inside square brackets detected.

app/helpers/works_helper.rb
@@ -96,12 +96,12 @@ def marked_for_later?(work)
reading && reading.toread?
end
- def marktoread_link(work)
- link_to ts("Mark for Later"), marktoread_work_path(work)
+ def markasread_link(work)
@sarken

sarken Jun 9, 2016

Owner

This should be mark_as_read_link(work) now that we're using the underscores between each word.

- def self.mark_to_read_later(work, user)
- reading_json = [user.id, Time.now, work.id, work.major_version, work.minor_version, true].to_json
- REDIS_GENERAL.sadd("Reading:new", reading_json)
+ def self.mark_to_read_later(work, user, toread)
@sarken

sarken Jun 9, 2016

Owner

Should we be calling this mark_for_later instead now, or would that involve changing too many things in too many places?

@zz9pzza

zz9pzza Jun 9, 2016

Contributor

It would be mark as read if anything, but that name is being used to remove something from the to read table. And I think right now I would get a headache

- <% unless current_user.is_author_of?(@work) || current_user.try(:preference).try(:history_enabled) == false || marked_for_later?(@work) %>
- <li class="mark"><%= marktoread_link(@work) %></li>
+ <% unless current_user.is_author_of?(@work) || current_user.try(:preference).try(:history_enabled) == false %>
+ <li class="mark">
@sarken

sarken Jun 9, 2016

Owner

I think the indenting is off here -- this looks like one space instead of two. Also, line 57 will need to be mark_as_read_link(@work) to go with the change requested in my comment above

zz9pzza added some commits Jun 18, 2016

Contributor

zz9pzza commented Jun 18, 2016

@sarken I think that is all you wanted ?

@sarken sarken merged commit d2f37d4 into otwcode:master Aug 10, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound 2 violations found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment