fabrik42/acts_as_api

Obscure error when templates not defined in dependency order

crystalneth opened this issue · 2 comments

E.g.

api_accessible :private, :extend => :public do
end

api_accessible :public do
end

This gives an unhelpful:

can't convert nil into Hash error in a different place.

Suggest this:

  def api_accessible_attributes(api_template)
    begin send "api_accessible_#{api_template}".to_sym rescue nil end
  end

detect and print warnings if method is not defined.

Sorry I got this issue totally wrong. You are right, a warning makes sense!

Closing this for now. If you want to provide a patch for this feature I would happily look into it. :)