Closed tentwofour closed 7 years ago
This seems like a bug, actually.
PR's accepted for bugs?
Yes they are.
PRs get more consideration when they include unit tests and documentation.
On Apr 7, 2015, at 11:51 AM, Blair D. Patterson notifications@github.com wrote:
PR's accepted for bugs?
— Reply to this email directly or view it on GitHub https://github.com/j4mie/idiorm/issues/267#issuecomment-90617540.
Using Idiorm with Paris; I have a model from which I need to determine if a subset of fields has changed. When setting any of those values to '', or null, the _dirty_fields property is set as such:
So it knows that 'changed_field_set_to_null' is dirty, and persists it properly. However, asking my model if the property is dirty returns false:
Looking in idiorm.php, at the is_dirty method, on line 1966:
Changing that to correctly triggers that the field is dirty (but not sure if that affects other use-cases, it shouldn't, I don't think...)
The field in question is a one-to-one relation with another table, the FK is defined on the main table, and setup via 'belongs_to' in my Paris model. Everything works and persists properly, I just can't tell if that one field is actually dirty...
I feel I may be missing something obvious here?