Here's a question:
I have the exact same validation code in 2 different models.
OK, you're thinking, combine the models. Not in this case.
So, in Rails, is there a way to reference the same validation for 2
different models?
E.g.
validate :foo
def foo
bar
end
Appears in /models/a.rb and /models/b.rb
Can I make foo DRY?
TIA,
Craig
--~--~---------~--~----~------------~-------~--~----~
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 protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---