Skip to content

Commit

Permalink
🔧 Fix to create work_sheet by course assistant, #151
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshizaki committed Nov 8, 2018
1 parent 1e2712b commit a95d636
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def self.not_associated_by(user_id)
end

def self.work_sheet_distributable_by(user_id)
courses = associated_by(user_id, %w[manager staff])
courses = associated_by(user_id, %w[manager assistant])
courses.delete_if { |c| %w[draft open].exclude? c.status }
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def content_manageable?
def work_sheet_manageable?
return true if %w[admin manager].include? role
distributable_courses = Course.work_sheet_distributable_by id
return true unless distributable_courses.size.zero?
return true unless distributable_courses.empty?
false
end

Expand Down

0 comments on commit a95d636

Please sign in to comment.