tag:blogger.com,1999:blog-7821856652257554779.post6008096616667123067..comments2025-09-20T09:27:07.510+02:00Comments on Andrzej on Software: Dear Lazyweb: How can I put many classes in one file in a Rails app?Andrzej Krzywdahttp://www.blogger.com/profile/06399276063142826365noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7821856652257554779.post-43947646438771222422011-01-23T16:09:03.130+01:002011-01-23T16:09:03.130+01:00"It looks like you want to break Rails' c..."It looks like you want to break Rails' convention of "one class per file"."<br /><br />Yes, I'd prefer to have it possible.<br /><br />I don't think that this "feature" was ever advertised as a good thing. Was it? I don't see any value in it.<br /><br />Automatic class reloading in development mode could be implemented even when you have multiple classes per file.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-25279313646653226302011-01-23T15:43:31.504+01:002011-01-23T15:43:31.504+01:00It looks like you want to break Rails' convent...It looks like you want to break Rails' convention of "one class per file".Krzysztof Cierpisz (chris)https://www.blogger.com/profile/07838445516755908113noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-43463293422057896082011-01-22T02:05:15.002+01:002011-01-22T02:05:15.002+01:00I'd love to have the ability to cache classes ...I'd love to have the ability to cache classes in development mode, so that there's no need to restart the server after the files change. <br /><br />Actually, I could live with that, but I'm not the only developer in this project.<br /><br /><br />"I suspect this will never work when cache_classes = false, since Rails' magic expects to find files named after the class."<br /><br />I still hope that I can work around this "magic" somehow.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-44315758787139352402011-01-22T01:58:22.553+01:002011-01-22T01:58:22.553+01:00You say you tried in development mode, thus cache_...You say you tried in development mode, thus cache_classes = false. Have you tried with true, and requiring your files manually?<br /><br />I suspect this will never work when cache_classes = false, since Rails' magic expects to find files named after the class.Anonymousnoreply@blogger.com