Sha256: c16eaee238c4b24edc761cfad350520f1cff2df5d18f5a68f2917cde01a730f9
Contents?: true
Size: 537 Bytes
Versions: 9
Compression:
Stored size: 537 Bytes
Contents
module LazyCrud module BeforeHookMethods include Constants ACTIONS_WITH_HOOKS.each do |action| # runs all of the hooks define_method("run_before_#{action}_hooks") do hook_list = self.send("before_#{action}_hooks") if hook_list hook_list.each do |hook| hook.call(@resource) end end # run the before action method if it exists if respond_to?("before_#{action}") self.send("before_#{action}") end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems