Created
October 11, 2012 17:15
-
-
Save yuki24/3874018 to your computer and use it in GitHub Desktop.
a patch to get jbuilder to work with active_decorator on Rails.
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
# lib/jbuilder_ext/object_methods.rb | |
module JbuilderExt | |
module ObjectMethods | |
def __class__ | |
(class << self; self; end).superclass | |
end | |
def is_a?(klass) | |
klass == __class__ | |
end | |
end | |
end | |
# config/initialisers/view_template_extensions.rb | |
JbuilderTemplate.send(:include, JbuilderExt::ObjectMethods) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment