in reply to Inflating foreign key values in Class::DBI

Your code fragment looks wrong to me. @ints is a list of BusinessHours objects, but you iterate through them and read their id() in order to re-load the same BusinessHours object. Why? (Did you not realize that $day is a BusinessHours object?)

Then you have this line where you are using $_ and assigning to it at the same time. $day is a BusinessHours object too, and when you call $day->get($_) that will stringify to something like $day->get($_->interval_id()).

I can't tell what you were trying to do here, but this code is almost certainly not what you meant. If you want to get the inflated object, call $_->int_dow() instead.

  • Comment on Re: Inflating foreign key values in Class::DBI