-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from tvdeyen/rename-alchemy-base-controller-ex…
…tension Rename Alchemy::BaseController extension constant
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
Alchemy::BaseController.class_eval do | ||
before_action :store_user_request_time | ||
module Alchemy | ||
module BaseControllerExtension | ||
def self.prepended(base) | ||
base.before_action(:store_user_request_time) | ||
end | ||
|
||
private | ||
private | ||
|
||
# Stores the users request time. | ||
def store_user_request_time | ||
if alchemy_user_signed_in? | ||
current_alchemy_user.store_request_time! | ||
# Stores the users request time. | ||
def store_user_request_time | ||
if alchemy_user_signed_in? | ||
current_alchemy_user.store_request_time! | ||
end | ||
end | ||
end | ||
end | ||
|
||
Alchemy::BaseController.prepend Alchemy::BaseControllerExtension |