Skip to content

Commit

Permalink
Revert "Changed inner join query to direct query on Lesson"
Browse files Browse the repository at this point in the history
This reverts commit fb774e7.

Querying for lessons by this field causes incorrect lessons to appear in
certain pages.  We should be querying by Lesson ID instead.
  • Loading branch information
muzfuz committed Jun 12, 2016
1 parent fb774e7 commit 6d02d99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

# vim artifacts
**.swp
.tags

# Ignore application configuration
/config/application.yml
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/lessons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def find_course
end

def find_lesson
@find_lesson ||= Lesson.find_by(title_url: lesson_title)
@find_lesson ||= find_course.lessons.find_by(title_url: lesson_title)
end

def course_title
Expand Down

0 comments on commit 6d02d99

Please sign in to comment.