pry/pry — Issue #378: strange happenings near the circle K
Author: banister
Created: 2011-12-19 04:26:48+00:00
State: open
Labels: bug

`show-method` and `whereami` return different methods -- the one from `whereami` being the correct one. The theory is that the method in `whereami` is in fact the super method, this explains why `show-method` displays the local method instead, however, as opposed to this: `show-method --super` complains that there is no super method:

```
[97] (pry) #: 0> $ --super
Error: 'ActiveRecord::Railties::ControllerRuntime#process_action' has no super method. Type `show-method --help` for help.
```

```
[95] (pry) #: 0> whereami

Frame number: 2/61
Frame type: method

From: /Users/john/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.3/lib/abstract_controller/base.rb @ line 167 in ActiveRecord::Railties::ControllerRuntime#process_action:

162: # is the intended way to override action dispatching.
163: #
164: # Notice that the first argument is the method to be dispatched
165: # which is *not* necessarily the same as the action name.
166: def process_action(method_name, *args)
=>167: send_action(method_name, *args)
168: end
169:
170: # Actually call the method associated with the action. Override
171: # this method if you wish to change how action methods are called,
172: # not to add additional behavior around it. For example, you would
[96] (pry) #: 0> show-method

From: /Users/john/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railties/controller_runtime.rb @ line 13:
Number of lines: 7
Owner: ActiveRecord::Railties::ControllerRuntime
Visibility: protected

def process_action(action, *args)
# We also need to reset the runtime before each action
# because of queries in middleware or in cases we are streaming
# and it won't be cleaned up by the method below.
ActiveRecord::LogSubscriber.reset_runtime
super
end
[97] (pry) #: 0>
```