collin (owner)

Revisions

gist: 125371 Download_button fork
public
Public Clone URL: git://gist.github.com/125371.git
Embed All Files: show embed
callback_meta.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
          def before_password_verification method_sym, options={}, &block
            puts "Called before_password_verification: #{method_sym}, #{options.inspect}"
            if block_given?
              before :before_password_verification, method_sym, &block
            else
              before :before_password_verification do
                if options[:if]
                  return false unless send(options[:if])
                end
                
                if options[:unless]
                  return false if send(options[:unless])
                end
                
                send method_sym
              end
            end
          end