app/controllers/checkouts_controller.rb in enju_circulation-0.1.0 vs app/controllers/checkouts_controller.rb in enju_circulation-0.1.1

- old
+ new

@@ -33,11 +33,10 @@ if @user user = @user if current_user.try(:has_role?, 'Librarian') search.build do with(:username).equal_to user.username - with(:checked_in_at).equal_to nil unless user.profile.save_checkout_history end else if current_user == user redirect_to checkouts_url(format: params[:format]) return @@ -48,15 +47,12 @@ end else unless current_user.try(:has_role?, 'Librarian') search.build do with(:username).equal_to current_user.username - end - end - - unless current_user.profile.save_checkout_history? - search.build do - with(:checked_in_at).equal_to nil + unless current_user.profile.save_checkout_history? + with(:checked_in_at).equal_to nil + end end end end if current_user.try(:has_role?, 'Librarian')