Pass current model to RelationController view & manage scopes #2496

Merged
merged 1 commit into from Nov 17, 2016

Projects

None yet

2 participants

@LukeTowers
Contributor
LukeTowers commented Nov 16, 2016 edited

This improves the extensibility of the relation controller by passing the parent relation model to the query scope that will be applied to both the view and manage options. It allows the use of attributes of the parent relation model in the query scope applied to the relation.

This is a mirror of #2419, except for the relation controller instead of the record finder widget. If necessary, I can create a case in the test plugin, but if this is simple enough with the added reference to the prior PR to not require a case in the test plugin, that would be simpler for me :)

@daftspunk, let me know what you think.

@LukeTowers LukeTowers Pass current model to RelationController view & manage scopes
This improves the extensibility of the relation controller by passing the parent relation model to the query scope that will be applied to both the view and manage options. It allows the use of attributes of the parent relation model in the query scope applied to the relation.

This is a mirror of october/octobercms#2419, except for the relation controller instead of the record finder widget. If necessary, I can create a case in the test plugin, but if this is simple enough with the added reference to the prior PR to not require a case in the test plugin, that would be simpler for me :) 

@daftspunk, let me know what you think.
05ab8bd
@daftspunk
Member

Yep, looks good. Especially since we do it elsewhere already. Brings the logic in line with consistency.

@LukeTowers LukeTowers changed the base branch to octobercms:develop from octobercms:master Nov 17, 2016
@daftspunk daftspunk merged commit 97b0bc4 into octobercms:develop Nov 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@LukeTowers LukeTowers added a commit to LukeTowers/library that referenced this pull request Nov 25, 2016
@LukeTowers LukeTowers Pass parent model to relation scopes
This improves the extensibility of relationships by passing the parent relation model to the query scope that will be applied to relation. It allows the use of attributes of the parent relation model in the query scope applied to the relation.

This is a mirror of octobercms/october#2419 and octobercms/october#2496, except that it effects scopes applied in the relationship configuration itself instead of the recordfinder or relationcontroller widgets. If necessary, I can create a case in the test plugin, but if this is simple enough with the added reference to the prior PR to not require a case in the test plugin, that would be simpler for me :)
0481822
@LukeTowers LukeTowers referenced this pull request in octobercms/library Nov 25, 2016
Merged

Pass parent model to relation scopes #246

@octoberapp octoberapp pushed a commit to octoberrain/database that referenced this pull request Nov 28, 2016
@LukeTowers LukeTowers Pass parent model to relation scopes
This improves the extensibility of relationships by passing the parent relation model to the query scope that will be applied to relation. It allows the use of attributes of the parent relation model in the query scope applied to the relation.

This is a mirror of octobercms/october#2419 and octobercms/october#2496, except that it effects scopes applied in the relationship configuration itself instead of the recordfinder or relationcontroller widgets. If necessary, I can create a case in the test plugin, but if this is simple enough with the added reference to the prior PR to not require a case in the test plugin, that would be simpler for me :)
b4d42c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment