module ApiTemplateOverride
def allowed_to_render?(fieldset, field, model, options)
return false if !super
module ApiTemplateOverride
def allowed_to_render?(fieldset, field, model, options)
return false if !super
# The obvious render(json: ...) forces a slow JSON encoder. See
# #3021 and commit logs. Might be fixed in Rails 4.1.
render({
# The obvious render(json: ...) forces a slow JSON encoder. See
# #3021 and commit logs. Might be fixed in Rails 4.1.
render({
def load_json_value(hash, key, must_be_class=nil)
if hash[key].is_a? String
def load_json_value(hash, key, must_be_class=nil)
if hash[key].is_a? String
if must_be_class and !hash[key].is_a? must_be_class
raise TypeError.new("parameter #{key.to_s} must be a #{must_be_class.to_s}")
end
if must_be_class and !hash[key].is_a? must_be_class
raise TypeError.new("parameter #{key.to_s} must be a #{must_be_class.to_s}")
end