Code was not adding foreign_type constraint#5
Conversation
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] }
|
@tispratik Thanks for the pull request for this. I will merge this in and release a new version of the gem at some point soon. |
|
Awesome thanks! On Fri, Feb 21, 2014 at 11:56 AM, doliveirakn notifications@github.comwrote:
|
Code was not adding foreign_type constraint
|
This has been merged. I have released a new point release for this change. |
|
Awesome! Thanks! On Tue, Feb 25, 2014 at 3:16 PM, doliveirakn notifications@github.comwrote:
|
|
You will probably need to bump up the version here On Tue, Feb 25, 2014 at 3:16 PM, pratik khadloya tispratik@gmail.comwrote:
|
|
haha, I did, It was just wasn't pushed up yet. |
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] }