I like this, and i believe most people would.
I can't say for the core team, but i think you sould create a patch
and post it on trac. The automatically validation can be improved to
more than just validates_presence_of as well, others people might help
with that and then it would be easier to apply the patch on the trunk
;)

Nice job, Nic.

Cheers!

Rodrigo Kochenburger

On 8/14/06, Dr. Ernie Prabhakar <[EMAIL PROTECTED]> wrote:

Hi Nic,

I for one think this is incredibly cool, and would love to see it in Rails
1.2 (as part of core)...

Thanks!
-- Ernie P.

On Aug 8, 2006, at 3:33 AM, Nic Williams wrote:

I've written an ActiveRecord extension that allows Associations to be
automatically generated at runtime without requiring "has_many" and
"belongs_to" to be defined in the class. The use of has_many vs has_one is
determined by the pluralisation of the method call.

Additionally, it uses the :null => false attribute of columns to provide
validates_presence_of automatically to models too.

If any of this code is relevant for Core Rails, let me know and I'll extract
it from the gem and create a patch for core. The gem has received a good
reception on the Ruby + RoR forums.

http://drnicwilliams.com/2006/08/07/ann-dr-nics-magic-models/

Cheers
Nic

--
Dr Nic Williams
 http://www.drnicwilliams.com - Ruby/Rails blog
skype: nicwilliams
(m) +31 62 494 8552
(p) +61 7 3305 7522 (finds me anywhere in the world)
(f) +61 7 3305 7572 (sends fax to my email)

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core





--
Rodrigo Kochenburger
<divoxx at gmail dot com>
Linkedin professional profile: http://www.linkedin.com/in/rodrigok
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to