doliveirakn/polymorphic_integer_type — pull request #5 by tispratik (2014-02-21 19:52:03+00:00)
Title: Code was not adding foreign_type constraint

When we already had some constraints on the relation definition.

Ex, below case did not work:
has_many :constraints, as: :restricted_object, integer_type: true,
:conditions => { :is_deleted => false }

A workaround prior to this commit was to use the reverse mapping:
has_many :constraints, as: :restricted_object, integer_type: true,
:conditions => { :is_deleted => false, restricted_object_type: RESTRICTED_OBJECT_MAP_REVERSE[self.to_s] }