Commit ac9adb0
committed
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] }1 parent d9e5a33 commit ac9adb0
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
0 commit comments