Skip to content

Conditions in association do not work with "hash" syntax #482

Open
@koenpunt

Description

@koenpunt

Currently, conditions in an association have to be SQL formatted, and the "hash" array syntax doesn't work.

$has_many = [
    ['available_agencies',
        'class_name' => 'Agency',
        'foreign_key' => 'category_id',
        // 'conditions' => ['enabled' => true] // doesn't work
        'conditions' => ['enabled = ?', true]  // works
    ]
];

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions