开发者

If you modify code in the Rails console will that affect a server running in parallel?

Is it possible to run "rails console" in one shell and then "rails server" in another and then have code changes in the console permeate to the running application? Presumably this isn'开发者_开发问答t possible, but I'd just like to check if there is a way.

Edit: Both are running in the same environment. And by code changes I mean changes to class definitions (e.g. rewriting a method on the Post model).


If you modify any data, that will indeed permeate. However modifications to methods done on the fly by opening classes and "monkey-patching" them will not affect your running application - unless your modified method modifies data.

However, it is always advisable to run the console in a different environment with different data to avoid harming a running application.


If you are changing data in your console IN THE SAME ENVIRONMENT then it will be changed in the browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜