remote_model
remote_model copied to clipboard
Set RemoteModel.root_url dependent on RUBYMOTION_ENV
Hi,
I wanted to set the root url depending on the environment. I figured I'd try use the RUBYMOTION_ENV. But I get uninitialised constant error.
I have the RemoteModel.rb file in app/initializers/. Is there a way to have the class initialize after the constant has been loaded? For example in the rakefile using app.file_dependencies or something?
Thanks
Wait what is the initialized constant in question? RUBYMOTION_ENV?
Also I'd recommend not using remote_model and instead looking into this: https://github.com/clayallsopp/maglev it's basically a more stable rewrite of remote_model.
Yeah, RUBYMOTION_ENV returns 'development', 'test' or 'release'. It is used in unit testing to test controllers in isolation. I figured I might try use it to determine my root urls.
Will have a look at that link. Thanks!