Skip to content

Instantly share code, notes, and snippets.

@greatseth
Created November 13, 2008 18:30
Show Gist options
  • Select an option

  • Save greatseth/24547 to your computer and use it in GitHub Desktop.

Select an option

Save greatseth/24547 to your computer and use it in GitHub Desktop.
# >> Video 1
# => #<Video ...>
def method_missing msg, *args, &block
model = begin;
Object.const_get msg
rescue NameError
end
if model and model.descends_from_active_record?
model.find args.first
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment