remote_model icon indicating copy to clipboard operation
remote_model copied to clipboard

Set RemoteModel.root_url dependent on RUBYMOTION_ENV

Open ashramsey opened this issue 12 years ago • 2 comments
trafficstars

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

ashramsey avatar Dec 29 '12 06:12 ashramsey

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.

clayallsopp avatar Jan 03 '13 05:01 clayallsopp

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!

ashramsey avatar Jan 03 '13 07:01 ashramsey