I was trying to be a little creative and play around with ruby. In my
RoR model file I wrote this:
Hash['title', 'teaser'].each do |k ,v|
validates v.to_sym :presence => true
It's fairly obvious what I'm trying to achieve here, but the validation
is only set for the last element, 'teaser'. I know there is something
about ruby block only returning the last line (or something), but is
there a way to circumvent that?
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.