From 342e0dbe8ccb9928b2204373f8be4136b0b2ef64 Mon Sep 17 00:00:00 2001 From: fake-or-dead Date: Fri, 4 Oct 2013 16:51:06 +0700 Subject: [PATCH 1/2] Update template.rb --- lib/json_builder/template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/json_builder/template.rb b/lib/json_builder/template.rb index 251ffa6..2846503 100644 --- a/lib/json_builder/template.rb +++ b/lib/json_builder/template.rb @@ -31,7 +31,7 @@ def compile(template) %{ end # Rails 3.X and 4.X Template -if defined?(Rails) && Rails.version.starts_with?('3', '4') +if defined?(Rails) && Rails.version.to_s.starts_with?('3', '4') module ActionView module Template::Handlers class JSONBuilder From 9bc3ec09421fdb2006da5ded92ee5d71dddacf86 Mon Sep 17 00:00:00 2001 From: fake-or-dead Date: Thu, 20 Feb 2014 17:19:12 +0700 Subject: [PATCH 2/2] add ignore scope for label --- lib/json_builder/compiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/json_builder/compiler.rb b/lib/json_builder/compiler.rb index 13461c2..26e4251 100644 --- a/lib/json_builder/compiler.rb +++ b/lib/json_builder/compiler.rb @@ -172,7 +172,7 @@ def copy_instance_variables_from(object, exclude = []) #:nodoc: # # Returns an Array of Symbols. def ignore_scope_methods - [:id] + [:id, :label] end end end