On Monday, 23 July 2012 at 7:29 AM, Weston Platter wrote:
> I added content on how to extend Rails Engine models. Please feel free to review and provide feedback.
> https://github.com/lifo/docrails/commit/890b9dd4439986e306ec4fc0067a0... > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Documentation" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-docs/-/IJBXpYpa0skJ.
> To post to this group, send email to rubyonrails-docs@googlegroups.com (mailto:rubyonrails-docs@googlegroups.com).
> To unsubscribe from this group, send email to rubyonrails-docs+unsubscribe@googlegroups.com (mailto:rubyonrails-docs+unsubscribe@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/rubyonrails-docs?hl=en.
These are interesting ideas, Weston, but it's not at all clear to me that an engine is the appropriate place for model decorators. In my opinion, an engine should implement a major block of functionality (possibly re-usable) that is self-contained enough to warrant carving it out of the main app as a separate piece. If a decorator pattern makes sense, I feel that it should be within the main app. What is it that suggests using an engine for model extensions?
A related question that I don't know the answer to is: are Rails engines reloaded for each request in development environment, or is it necessary to restart the server in order for changes to take effect?
The engine *is* a separate component. These modifications are inside the application and are modifying the engine's class.
I would not use an engine for model extensions for a main app, given the reasons you've already cited.
Rails engines *are* reloaded each request in development environment and it's not necessary to restart the server in order for changes to take effect. This seems like something worth mentioning in the guide.
On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
> These are interesting ideas, Weston, but it's not at all clear to me that an engine is the appropriate place for model decorators. In my opinion, an engine should implement a major block of functionality (possibly re-usable) that is self-contained enough to warrant carving it out of the main app as a separate piece. If a decorator pattern makes sense, I feel that it should be within the main app. What is it that suggests using an engine for model extensions?
> A related question that I don't know the answer to is: are Rails engines reloaded for each request in development environment, or is it necessary to restart the server in order for changes to take effect?
> cheers
> Les
> On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
> > I added content on how to extend Rails Engine models. Please feel free to review and provide feedback.
> > https://github.com/lifo/docrails/commit/890b9dd4439986e306ec4fc0067a0... > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Documentation" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ.
> To post to this group, send email to rubyonrails-docs@googlegroups.com (mailto:rubyonrails-docs@googlegroups.com).
> To unsubscribe from this group, send email to rubyonrails-docs+unsubscribe@googlegroups.com (mailto:rubyonrails-docs+unsubscribe@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/rubyonrails-docs?hl=en.
On Sunday, July 22, 2012 3:32:23 PM UTC-7, Ryan Bigg wrote:
> I think you may have mis-interpreted the text.
> The engine *is* a separate component. These modifications are inside the > application and are modifying the engine's class.
> I would not use an engine for model extensions for a main app, given the > reasons you've already cited.
> Rails engines *are* reloaded each request in development environment and > it's not necessary to restart the server in order for changes to take > effect. This seems like something worth mentioning in the guide.
> On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
> These are interesting ideas, Weston, but it's not at all clear to me that > an engine is the appropriate place for model decorators. In my opinion, an > engine should implement a major block of functionality (possibly re-usable) > that is self-contained enough to warrant carving it out of the main app as > a separate piece. If a decorator pattern makes sense, I feel that it should > be within the main app. What is it that suggests using an engine for model > extensions?
> A related question that I don't know the answer to is: are Rails engines > reloaded for each request in development environment, or is it necessary to > restart the server in order for changes to take effect?
> cheers
> Les
> On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
> I added content on how to extend Rails Engine models. Please feel free to > review and provide feedback.
> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Documentation" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ. > To post to this group, send email to rubyonrails-docs@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-docs+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-docs?hl=en.
*Ryan* can you explain this a little more? It sounds like you are saying you would not extend main application models by open classing them in the engine.
I would not use an engine for model extensions for a main app, given the
> reasons you've already cited.
*Less*, no worries at all. If I separated the code chunks into some like this, would it be more clear? (if you mis-read it, other people might do the same). https://gist.github.com/3169009
On Sunday, July 22, 2012 6:58:49 PM UTC-4, Les Nightingill wrote:
> oops thanks for the clarification, Ryan. Indeed I misinterpreted the code. > Sorry Weston!
> On Sunday, July 22, 2012 3:32:23 PM UTC-7, Ryan Bigg wrote:
>> I think you may have mis-interpreted the text.
>> The engine *is* a separate component. These modifications are inside the >> application and are modifying the engine's class.
>> I would not use an engine for model extensions for a main app, given the >> reasons you've already cited.
>> Rails engines *are* reloaded each request in development environment and >> it's not necessary to restart the server in order for changes to take >> effect. This seems like something worth mentioning in the guide.
>> On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
>> These are interesting ideas, Weston, but it's not at all clear to me that >> an engine is the appropriate place for model decorators. In my opinion, an >> engine should implement a major block of functionality (possibly re-usable) >> that is self-contained enough to warrant carving it out of the main app as >> a separate piece. If a decorator pattern makes sense, I feel that it should >> be within the main app. What is it that suggests using an engine for model >> extensions?
>> A related question that I don't know the answer to is: are Rails engines >> reloaded for each request in development environment, or is it necessary to >> restart the server in order for changes to take effect?
>> cheers
>> Les
>> On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
>> I added content on how to extend Rails Engine models. Please feel free to >> review and provide feedback.
>> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Documentation" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ. >> To post to this group, send email to rubyonrails-docs@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-docs+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-docs?hl=en.
I think that an engine's purpose is to provide additional functionality to an application with *new* classes, not to extend ones that are already there. For that kind of thing, I think a gem is better suited for that. Why would something that extends a class need to be inside an engine? Do you have a use case?
On Tuesday, 24 July 2012 at 7:13 PM, Weston Platter wrote:
> Ryan can you explain this a little more? It sounds like you are saying you would not extend main application models by open classing them in the engine.
> > I would not use an engine for model extensions for a main app, given the reasons you've already cited.
> Less, no worries at all. If I separated the code chunks into some like this, would it be more clear? (if you mis-read it, other people might do the same).
> https://gist.github.com/3169009
> On Sunday, July 22, 2012 6:58:49 PM UTC-4, Les Nightingill wrote:
> > oops thanks for the clarification, Ryan. Indeed I misinterpreted the code. Sorry Weston!
> > On Sunday, July 22, 2012 3:32:23 PM UTC-7, Ryan Bigg wrote:
> > > I think you may have mis-interpreted the text.
> > > The engine *is* a separate component. These modifications are inside the application and are modifying the engine's class.
> > > I would not use an engine for model extensions for a main app, given the reasons you've already cited.
> > > Rails engines *are* reloaded each request in development environment and it's not necessary to restart the server in order for changes to take effect. This seems like something worth mentioning in the guide.
> > > On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
> > > > These are interesting ideas, Weston, but it's not at all clear to me that an engine is the appropriate place for model decorators. In my opinion, an engine should implement a major block of functionality (possibly re-usable) that is self-contained enough to warrant carving it out of the main app as a separate piece. If a decorator pattern makes sense, I feel that it should be within the main app. What is it that suggests using an engine for model extensions?
> > > > A related question that I don't know the answer to is: are Rails engines reloaded for each request in development environment, or is it necessary to restart the server in order for changes to take effect?
> > > > cheers
> > > > Les
> > > > On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
> > > > > I added content on how to extend Rails Engine models. Please feel free to review and provide feedback.
> > > > > https://github.com/lifo/docrails/commit/890b9dd4439986e306ec4fc0067a0... > > > > -- > > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Documentation" group.
> > > > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ.
> > > > To post to this group, send email to rubyonrails-docs@googlegroups.com (mailto:rubyonrails-docs@googlegroups.com).
> > > > To unsubscribe from this group, send email to rubyonrails-docs+unsubscribe@googlegroups.com (mailto:rubyonrails-docs+unsubscribe@googlegroups.com).
> > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-docs?hl=en.
> -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Documentation" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-docs/-/VleBHY_uRy4J.
> To post to this group, send email to rubyonrails-docs@googlegroups.com (mailto:rubyonrails-docs@googlegroups.com).
> To unsubscribe from this group, send email to rubyonrails-docs+unsubscribe@googlegroups.com (mailto:rubyonrails-docs+unsubscribe@googlegroups.com).
> For more options, visit this group at http://groups.google.com/group/rubyonrails-docs?hl=en.
On Wednesday, July 25, 2012 2:36:23 AM UTC-4, Ryan Bigg wrote:
> I think that an engine's purpose is to provide additional functionality > to an application with *new* classes, not to extend ones that are already > there. For that kind of thing, I think a gem is better suited for that. Why > would something that extends a class need to be inside an engine? Do you > have a use case?
> On Tuesday, 24 July 2012 at 7:13 PM, Weston Platter wrote:
> *Ryan* can you explain this a little more? It sounds like you are saying > you would not extend main application models by open classing them in the > engine.
> I would not use an engine for model extensions for a main app, given the > reasons you've already cited.
> *Less*, no worries at all. If I separated the code chunks into some like > this, would it be more clear? (if you mis-read it, other people might do > the same). > https://gist.github.com/3169009
> On Sunday, July 22, 2012 6:58:49 PM UTC-4, Les Nightingill wrote:
> oops thanks for the clarification, Ryan. Indeed I misinterpreted the code. > Sorry Weston!
> On Sunday, July 22, 2012 3:32:23 PM UTC-7, Ryan Bigg wrote:
> I think you may have mis-interpreted the text.
> The engine *is* a separate component. These modifications are inside the > application and are modifying the engine's class.
> I would not use an engine for model extensions for a main app, given the > reasons you've already cited.
> Rails engines *are* reloaded each request in development environment and > it's not necessary to restart the server in order for changes to take > effect. This seems like something worth mentioning in the guide.
> On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
> These are interesting ideas, Weston, but it's not at all clear to me that > an engine is the appropriate place for model decorators. In my opinion, an > engine should implement a major block of functionality (possibly re-usable) > that is self-contained enough to warrant carving it out of the main app as > a separate piece. If a decorator pattern makes sense, I feel that it should > be within the main app. What is it that suggests using an engine for model > extensions?
> A related question that I don't know the answer to is: are Rails engines > reloaded for each request in development environment, or is it necessary to > restart the server in order for changes to take effect?
> cheers
> Les
> On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
> I added content on how to extend Rails Engine models. Please feel free to > review and provide feedback.
> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Documentation" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ. > To post to this group, send email to rubyonrails-docs@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-docs+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-docs?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Documentation" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-docs/-/VleBHY_uRy4J. > To post to this group, send email to rubyonrails-docs@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-docs+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-docs?hl=en.
On Wednesday, July 25, 2012 7:52:04 AM UTC-5, Weston Platter wrote:
> I agree.
> Engines should provide classes to the Main App. The Main app can choose to > use, extend, and override the Engine classes.z
> On Wednesday, July 25, 2012 2:36:23 AM UTC-4, Ryan Bigg wrote:
>> I think that an engine's purpose is to provide additional functionality >> to an application with *new* classes, not to extend ones that are already >> there. For that kind of thing, I think a gem is better suited for that. Why >> would something that extends a class need to be inside an engine? Do you >> have a use case?
>> On Tuesday, 24 July 2012 at 7:13 PM, Weston Platter wrote:
>> *Ryan* can you explain this a little more? It sounds like you are saying >> you would not extend main application models by open classing them in the >> engine.
>> I would not use an engine for model extensions for a main app, given the >> reasons you've already cited.
>> *Less*, no worries at all. If I separated the code chunks into some like >> this, would it be more clear? (if you mis-read it, other people might do >> the same). >> https://gist.github.com/3169009
>> On Sunday, July 22, 2012 6:58:49 PM UTC-4, Les Nightingill wrote:
>> oops thanks for the clarification, Ryan. Indeed I misinterpreted the >> code. Sorry Weston!
>> On Sunday, July 22, 2012 3:32:23 PM UTC-7, Ryan Bigg wrote:
>> I think you may have mis-interpreted the text.
>> The engine *is* a separate component. These modifications are inside the >> application and are modifying the engine's class.
>> I would not use an engine for model extensions for a main app, given the >> reasons you've already cited.
>> Rails engines *are* reloaded each request in development environment and >> it's not necessary to restart the server in order for changes to take >> effect. This seems like something worth mentioning in the guide.
>> On Monday, 23 July 2012 at 8:30 AM, Les Nightingill wrote:
>> These are interesting ideas, Weston, but it's not at all clear to me that >> an engine is the appropriate place for model decorators. In my opinion, an >> engine should implement a major block of functionality (possibly re-usable) >> that is self-contained enough to warrant carving it out of the main app as >> a separate piece. If a decorator pattern makes sense, I feel that it should >> be within the main app. What is it that suggests using an engine for model >> extensions?
>> A related question that I don't know the answer to is: are Rails engines >> reloaded for each request in development environment, or is it necessary to >> restart the server in order for changes to take effect?
>> cheers
>> Les
>> On Sunday, July 22, 2012 2:29:43 PM UTC-7, Weston Platter wrote:
>> I added content on how to extend Rails Engine models. Please feel free to >> review and provide feedback.
>> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Documentation" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-docs/-/IgoWqn2wO7QJ. >> To post to this group, send email to rubyonrails-docs@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-docs+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-docs?hl=en.
>> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Documentation" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/rubyonrails-docs/-/VleBHY_uRy4J. >> To post to this group, send email to rubyonrails-docs@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-docs+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-docs?hl=en.