Skip to content

Instantly share code, notes, and snippets.

@anbublacky
Last active April 18, 2017 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anbublacky/a6e66217b2fcdeb52fe580864beecf7f to your computer and use it in GitHub Desktop.
Save anbublacky/a6e66217b2fcdeb52fe580864beecf7f to your computer and use it in GitHub Desktop.
Uninitialized constant.
# app/api/proj/api/v2/entities/committee_base.rb
module PROJ::API::V2::Entities
class CommitteeBase < Grape::Entity;
expose :id
end
class CommitteeOffice < CommitteeBase;
expose :name
end
end
present @committees, with: PROJ::API::V2::Entities::CommitteeOffice
Error:
uninitialized constant PROJ::API::V2::Entities::CommitteeOffice
If i use
present @committees, with: PROJ::API::V2::Entities::CommitteeBase
its working
Even i have the autoload paths app/api/* in application.rb
If i make CommitteOffice into a seperate file its working. but i dont want it in a seperate file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment