3 ms·
"I have a module called “Authenticatable” that handles membership for me. I can attach it to whatever model object I please (Customer, Account, User, whatever)
by dlikhten 15y ago
"I have a module called “Authenticatable” that handles membership for me. I can attach it to whatever model object I please (Customer, Account, User, whatever) and guess what it can do! Ruby is really a fascinating language when you take the time to understand it beyond a demo that makes you hate it. Did you know Ruby is older than C#? It is."
I been doing this exact thing in my project. Core behaviors are now modules included in my AR classes. I can make anything authenticatable, or locatable, etc etc etc. One of my classes "extends" many modules, each one independently tested and gives some specific behavior to any object it takes.
Granted, rails is not good as a long-term framework for long-lived projects. It's a great starting point. Eventually you will use less rails and more custom services. I think of rails like facebook thinks of PHP -- front end code.