Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
New Engine Model extension content
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Weston Platter  
View profile  
 More options Jul 22 2012, 5:29 pm
From: Weston Platter <westonplat...@gmail.com>
Date: Sun, 22 Jul 2012 14:29:43 -0700 (PDT)
Local: Sun, Jul 22 2012 5:29 pm
Subject: New Engine Model extension content

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Bigg  
View profile  
 More options Jul 22 2012, 6:10 pm
From: Ryan Bigg <radarliste...@gmail.com>
Date: Mon, 23 Jul 2012 08:10:49 +1000
Local: Sun, Jul 22 2012 6:10 pm
Subject: Re: [Rails-docs] New Engine Model extension content

Thank you for doing some work on this Weston. I've left a comment here with my thoughts https://github.com/lifo/docrails/commit/890b9dd4439986e306ec4fc0067a0...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Les Nightingill  
View profile  
 More options Jul 22 2012, 6:30 pm
From: Les Nightingill <codehac...@comcast.net>
Date: Sun, 22 Jul 2012 15:30:24 -0700 (PDT)
Local: Sun, Jul 22 2012 6:30 pm
Subject: Re: New Engine Model extension content

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Bigg  
View profile  
 More options Jul 22 2012, 6:32 pm
From: Ryan Bigg <radarliste...@gmail.com>
Date: Mon, 23 Jul 2012 08:32:23 +1000
Local: Sun, Jul 22 2012 6:32 pm
Subject: Re: [Rails-docs] Re: New Engine Model extension content

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Les Nightingill  
View profile  
 More options Jul 22 2012, 6:58 pm
From: Les Nightingill <codehac...@comcast.net>
Date: Sun, 22 Jul 2012 15:58:49 -0700 (PDT)
Local: Sun, Jul 22 2012 6:58 pm
Subject: Re: [Rails-docs] Re: New Engine Model extension content

oops thanks for the clarification, Ryan. Indeed I misinterpreted the code.
Sorry Weston!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Weston Platter  
View profile  
 More options Jul 24 2012, 5:13 am
From: Weston Platter <westonplat...@gmail.com>
Date: Tue, 24 Jul 2012 02:13:56 -0700 (PDT)
Local: Tues, Jul 24 2012 5:13 am
Subject: Re: [Rails-docs] Re: New Engine Model extension content

*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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Bigg  
View profile  
 More options Jul 25 2012, 2:36 am
From: Ryan Bigg <radarliste...@gmail.com>
Date: Wed, 25 Jul 2012 16:36:23 +1000
Local: Wed, Jul 25 2012 2:36 am
Subject: Re: [Rails-docs] Re: New Engine Model extension content

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?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Weston Platter  
View profile  
 More options Jul 25 2012, 8:52 am
From: Weston Platter <westonplat...@gmail.com>
Date: Wed, 25 Jul 2012 05:52:04 -0700 (PDT)
Local: Wed, Jul 25 2012 8:52 am
Subject: Re: [Rails-docs] Re: New Engine Model extension content

I agree.

Engines should provide classes to the Main App. The Main app can choose to
use, extend, and override the Engine classes.z


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Weston Platter  
View profile  
 More options Aug 4 2012, 8:16 pm
From: Weston Platter <westonplat...@gmail.com>
Date: Sat, 4 Aug 2012 17:16:20 -0700 (PDT)
Local: Sat, Aug 4 2012 8:16 pm
Subject: Re: [Rails-docs] Re: New Engine Model extension content

Edited http://edgeguides.rubyonrails.org/engines.html

explained how to add/override engine classes in the main rails app using
decorator pattern via
1) Class#class_eval
2) ActiveSupport::Concern

Feedback is welcome.
https://github.com/lifo/docrails/commit/39674d1e90a99f40f591cf97064f1...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »