Skip to content

Commit

Permalink
fix module missing error
Browse files Browse the repository at this point in the history
After including this Gem in my project, and working around issue efexen#13 I
then encountered this error:
> messenger_platform/engine.rb:1:in `<top (required)>':
> uninitialized constant MessengerPlatform (NameError)

Fix it by separating the module declaration from the class declaration
to ensure the module exists before the class definition.
  • Loading branch information
LUCASAU authored and Lucas Nelson committed May 19, 2016
1 parent c475ff1 commit 32c1fb8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/messenger_platform/engine.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
class MessengerPlatform::Engine < ::Rails::Engine
isolate_namespace MessengerPlatform
module Messenger
class Engine < ::Rails::Engine
isolate_namespace MessengerPlatform
end
end

0 comments on commit 32c1fb8

Please sign in to comment.