Perhaps I way off base, but to "extend" (overide) the model write your 
own User class that includes the engine files as needed (the example 
below is for the login & user engine combination). This allows you to 
add validation,  whatever.  To extend the engiine's controller, just add 
your own methods in your own user_controller and don't bother to include 
or copy anything from the engines-- unless you really need to that is. 
DRY enough?

-Jonathan

#
# note: this Overides the login and user engines, so it must include 
them
#

class User < ActiveRecord::Base
  include LoginEngine::AuthenticatedUser
  include UserEngine::AuthorizedUser
                validates_format_of :email, :with => .....
                has_many: ....
 def fullname
    "#{self.firstname} #{self.lastname}"
  end
end


Josh Rickard wrote:
> Hi all,
> 
> I have a few questions regarding the LoginEngine.
> 
> 1) What is the best way of extending the User model without starting to 
> make changes to the actual files?  I need to add some additional 
> functionality but preferably would like to keep it seperate from the 
> original stuff.  Can I create my own version of it as a child class so 
> that it inherits all the other stuff?
> 

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

Reply via email to