DBIx-Class-Helpers
DBIx-Class-Helpers copied to clipboard
Q: Why `Helper::Row::SelfResultSet` disables `InflateColumn::DateTime` if used first?
When I load components at this order:
Helper::Row::SelfResultSet
InflateColumn::DateTime
The DateTime fields are not deflated:
At point: https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082841/lib/DBIx/Class/Row.pm#L407
the $self object is:
DBG>$self
HyperMouse::Schema::Result::Contractor {
_column_data => {
contractor_type_id => 1,
known_from => DateTime 2018-07-13T13:18:24,
known_till => DateTime 9999-12-31T23:59:59,
name => Contractor,
provider => 1,
valid_from => DateTime 2018-07-13T13:18:24,
valid_till => DateTime 9999-12-31T23:59:59,
},
_in_storage => 0,
_result_source => IGNORED,
}
In compare when Helper::Row::SelfResultSet is last loaded component:
HyperMouse::Schema::Result::Contractor {
_column_data => {
contractor_type_id => 1,
name => Contractor,
provider => 1,
},
_in_storage => 0,
_inflated_column => {
known_from => DateTime 2018-07-13T13:19:47,
known_till => DateTime 9999-12-31T23:59:59,
valid_from => DateTime 2018-07-13T13:19:47,
valid_till => DateTime 9999-12-31T23:59:59,
},
_rel_in_storage => {},
_result_source => IGNORED,
}
Can you write a test that I can just run? You should be able to see if a $row has a compenent loaded by checking $row->isa('DBIx::Class::Helper::SelfResultSet'), for example.
@KES777 this is a known-ish issue within DBIC-land. I really hope I will be able to get a trial release of DBIC addressing this soon for you to try, but it's been setback after setback lately :( Stay tuned!