[DBIx-Class-Devel] [dbsrgits/DBIx-Class-Fixtures] Exclude virtual columns (#14)

Marc Mims notifications at github.com
Fri Sep 15 00:23:36 GMT 2017


`dump_object` dumps the hash returned by `get_columns`. If the result source includes virtual columns defined with `resultset_attributes`, they get dumped as well. Then populating from fixtures fails because the virtual columns don't exist in the table.

This change dumps only columns defined in `columns_info`, effectively excluding the virtual columns.

See t/lib/DBICTest/Schema3.pm for an example of a virtual column.

I'm not sure this in the best (or correct) way to exclude virtual columns, or even if defining virtual columns this way is correct. But this fixes an issue I encountered in an existing database and passes all other tests as well.

Two commits. The first is a failing test. The second is the fix.
You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/14

-- Commit Summary --

  * Add failing test
  * Ignore virtual columns in dump_object

-- File Changes --

    M Changes (8)
    M dist.ini (1)
    M lib/DBIx/Class/Fixtures.pm (9)
    A t/20-virtual-column.t (57)
    A t/lib/DBICTest/Schema3.pm (71)
    A t/var/configs/virtual-columns.json (6)

-- Patch Links --

https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/14.patch
https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/14.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/DBIx-Class-Fixtures/pull/14
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20170915/1b80d968/attachment.htm>


More information about the DBIx-Class-Devel mailing list