Skip to content

Loading…

Set RemoteModel.root_url dependent on RUBYMOTION_ENV #4

Open
ashramsey opened this Issue · 2 comments

2 participants

@ashramsey

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

@clayallsopp
Owner

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.

@ashramsey

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!

@muescha muescha referenced this issue
Merged

Update README.md #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.