Nimster/RailsLookup — pull request #1 by redguy-p2pu (2012-09-05 21:07:38+00:00)
Title: :presence option to enable nil in lookup attributes

Hi,

I found your gem quite useful since I'm trying to use (over?)normalized schema in my project. After I used it in quite a lot of places I found that it adds a validation for presence of the lookup attribute. In some situations it is not desirable, so I implemented a solution in my branch. The visible part is the :presence option for lookup method which takes a boolean value. The default behavior is to have the validation (so it shouldn't break existing code), but if :presence is false the validation is not injected in the parent class. I also added test to check if it behaves properly. Please pull the feature if you find it useul.

Regards,

Mateusz