Skip to content

Commit

Permalink
[broken] progress on 3.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gatatactx committed Apr 14, 2016
1 parent a39bd08 commit a87f564
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/controllers/books_controller.rb
Expand Up @@ -12,7 +12,7 @@ class BooksController < ApplicationController
def index
@sort_by = %w(date title author).include?(params[:sort_by]) ? params[:sort_by] : 'category'
# books = Book.find_all_by_project_id(@project.id)
books = Book.find_by project_id: @project.id
books = Book.where(project_id: @project.id)
if (books==nil) then
@grouped={}
else
Expand All @@ -28,7 +28,7 @@ def index
end

def show
@book_chapters = @book.book_chapters.find(:all)
@book_chapters = @book.book_chapters
end

def new
Expand Down
8 changes: 4 additions & 4 deletions app/models/book.rb
Expand Up @@ -41,10 +41,10 @@ def book_chapters_visible?(user=User.current)
end

def updated_on
unless @updated_on
a = book_chapters.find(:first, :order => 'created_on DESC')
@updated_on = (a && a.created_on) || created_on
end
# unless @updated_on
# a = book_chapters.find(:all)#(:first, :order => 'created_on DESC')
# @updated_on = (a && a.created_on) || created_on
# end
@updated_on
end
end

1 comment on commit a87f564

@txinto
Copy link
Collaborator

@txinto txinto commented on a87f564 Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in updated_on looks like a containment to compile code without issues, probably there is some regresssion.

Please sign in to comment.