diff --git a/django/contrib/postgres/fields/array.py b/django/contrib/postgres/fields/array.py
index 9daea8e..27c369d 100644
a
|
b
|
class ArrayField(Field):
|
28 | 28 | self.default_validators.append(ArrayMaxLengthValidator(self.size)) |
29 | 29 | super(ArrayField, self).__init__(**kwargs) |
30 | 30 | |
| 31 | def contribute_to_class(self, cls, name, **kwargs): |
| 32 | super(ArrayField, self).contribute_to_class(cls, name, **kwargs) |
| 33 | self.base_field.model = cls |
| 34 | |
31 | 35 | def check(self, **kwargs): |
32 | 36 | errors = super(ArrayField, self).check(**kwargs) |
33 | 37 | if self.base_field.remote_field: |
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
index d152f76..d382d6d 100644
a
|
b
|
class TestSaveLoad(PostgreSQLTestCase):
|
97 | 97 | self.assertEqual(instance.uuids, loaded.uuids) |
98 | 98 | self.assertEqual(instance.decimals, loaded.decimals) |
99 | 99 | |
| 100 | def test_model_is_set_on_base_field_too(self): |
| 101 | instance = IntegerArrayModel() |
| 102 | |
| 103 | field = instance._meta.get_field('field') |
| 104 | self.assertEqual(field.model, IntegerArrayModel) |
| 105 | self.assertEqual(field.base_field.model, IntegerArrayModel) |
| 106 | |
100 | 107 | |
101 | 108 | class TestQuerying(PostgreSQLTestCase): |
102 | 109 | |