Created
November 20, 2017 10:25
-
-
Save bernardobarreto/bcaf118787db527ea91a55549706a539 to your computer and use it in GitHub Desktop.
bad practice application_controller example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ApplicationController < ActionController::Base | |
| before_action :increment_visits, only: [:index, :show, :new, :edit] | |
| private | |
| def increment_visits | |
| current_user.inc(visits: 1) # Mongoid ODM example | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment