Set RemoteModel.root_url dependent on RUBYMOTION_ENV #4

Open
ashramsey opened this Issue Dec 29, 2012 · 2 comments

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@clayallsopp

clayallsopp Jan 3, 2013

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.

Owner

clayallsopp commented Jan 3, 2013

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

This comment has been minimized.

Show comment
Hide comment
@ashramsey

ashramsey Jan 3, 2013

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!

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 Mar 21, 2013

Merged

Update README.md #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment