fabrik42/acts_as_api

Ruby 2.0, Rails Mongoid, and NoMethodError (undefined method `empty?' for nil:NilClass)

mrrooijen opened this issue · 1 comments

I'm seeing issues with the following combination:

  • Ruby 2.0.0-p0
  • Rails 3.2.12
  • Mongoid 3.1.2

(All latest versions at time of writing)

class UsersController < ApplicationController
  self.responder = ActsAsApi::Responder
  respond_to :json, :html

  def show
    respond_with current_user, :api_template => :public
  end
end

When I'm on Ruby 1.9.3 everything works. When I upgrade to Ruby 2.0 I get:

NoMethodError (undefined method `empty?' for nil:NilClass)

on this simple respond_with function.

Any idea what might be wrong?

I just updated all my dependencies (quite a bunch) and now I am no longer experiencing any issues. While I was already on the latest versions of Mongoid, Rails and ActsAsApi, it looks like some other dependency was messing with responders that needed to be updated.

Not sure what fix it, but I'm currently not seeing any issues, and it works as it did with Ruby 1.9.3.