-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 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
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
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module ActiveInteraction::Extras::NamedCallbacks | ||
extend ActiveSupport::Concern | ||
|
||
class_methods do | ||
def before_filter(...) | ||
set_callback(:filter, :before, ...) | ||
end | ||
|
||
def after_filter(...) | ||
set_callback(:filter, :after, ...) | ||
end | ||
|
||
def around_filter(...) | ||
set_callback(:filter, :around, ...) | ||
end | ||
|
||
|
||
def before_validate(...) | ||
set_callback(:validate, :before, ...) | ||
end | ||
|
||
def after_validate(...) | ||
set_callback(:validate, :after, ...) | ||
end | ||
|
||
def around_validate(...) | ||
set_callback(:validate, :around, ...) | ||
end | ||
|
||
|
||
def before_execute(...) | ||
set_callback(:execute, :before, ...) | ||
end | ||
|
||
def after_execute(...) | ||
set_callback(:execute, :after, ...) | ||
end | ||
|
||
def around_execute(...) | ||
set_callback(:execute, :around, ...) | ||
end | ||
end | ||
end |