search for: macroreflection

Displaying 4 results from an estimated 4 matches for "macroreflection".

2006 Jul 27
9
Introspecting validates_presence_of
Hello people, I''d like to detect whether an attribute of a model has vaildates_presence_of applied to it so I can automatically apply a mandatory (*) to the field...it doesn''t look easy...any ideas? Cheers, -- Dan Webb http://www.danwebb.net
2006 Jan 12
3
Introspecting Active Record Associations
Hi, I''m looking into write scaffold generators that will, amoung other things, scaffold active record associations (eg. generate select boxes for belongs_to where you can choose a parent object) for quicker prototyping. But... My question is: Is there anyway of finding out what associations exist from examining the lodel classes themselves or indeed any other way of finding out this
2007 Aug 14
2
Finding a models asscoations
Hi, I cant seem to find the answer to this anywhere so any help/advice is appreciated. Each project has one risk and a risk has a number of has/one belongs to assocations. So what i want to do is in my code loop through all the associations for a risk and display some field information from each as they are pretty similar. So somehting like <% for model_association in project.risks %>
2007 Mar 18
7
How to get more informations about an association at runtime
Hi all I''m working on a Custom Formbuilder. I want it to create me with a single method call checkboxes for a given HABTM association. My model looks like this: [code=ruby]class Member < ActiveRecord::Base has_and_belongs_to_many :preferred_music_styles, :class_name => ''MusicStyle'', :join_table =>