|
|
@ -1,7 +1,7 @@
|
|
|
|
class LibrariesController < ApplicationController
|
|
|
|
class LibrariesController < ApplicationController
|
|
|
|
layout 'base_library'
|
|
|
|
layout 'base_library'
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :require_login, :except => [:index]
|
|
|
|
before_filter :require_login, :except => [:index, :show]
|
|
|
|
after_filter :increment_visit_count, only: [:show, :create, :edit, :update]
|
|
|
|
after_filter :increment_visit_count, only: [:show, :create, :edit, :update]
|
|
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
def index
|
|
|
@ -121,7 +121,7 @@ class LibrariesController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def admin_or_self?
|
|
|
|
def admin_or_self?
|
|
|
|
current_library.user_id == current_user.id || admin_or_business?
|
|
|
|
current_library.try(:user_id) == current_user.try(:id) || admin_or_business?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def increment_visit_count
|
|
|
|
def increment_visit_count
|
|
|
|