Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table-specific configuration #64

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

amilligan
Copy link
Collaborator

Hey Chad, I've been working with some legacy projects which present unusual requirements for fixture_builder (e.g. in some cases I need more than one table for the same domain concept, and the naming is somewhat all over the place). I made some minor configuration enhancements here that allow the user to specify the model class and output file for a particular table.

So, for example, if you have the wibbles table, but you want the associated model class to be Legacy::Foo and the fixture file to be 'legacy/foos' this will allow you to do that with the following:

FixtureBuilder.configure do |fbuilder|
  ...
  fbuilder.configure_tables(wibbles: { file: "legacy/foos", class: Legacy::Foo })
  ...
end

Incidentally, I use FixtureBuilder pretty regularly and I'm happy to help with maintenance, if you need. I'd like to ensure that it survives, because it's damn useful.

Adam Milligan added 4 commits August 4, 2022 20:06
Authored-by: Adam Milligan <adam@redish.com>
Authored-by: Adam Milligan <adam@redish.com>
Authored-by: Adam Milligan <adam@redish.com>
Authored-by: Adam Milligan <adam@redish.com>
@thewoolleyman
Copy link
Collaborator

Hey @amilligan ! It would be great if you want to help out. I just haven't been using this in any of my active projects, so I haven't been motivated enough to hack on it myself.

That doesn't detract from the fact that I agree Fixture Builder is awesome, and I'd like to see it stay maintained and be used on more projects.

@rdy and I already had tried to reach out to another active forks about ownership, and got some initial interest, but then no follow up.

At this point, I think the best path forward is to transfer this repo from @rdy 's namespace and into its own organization: https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository

Then we can have multiple owners (including you), and start applying some of the PRs and publishing new gem versions from that repo.

If you're down with that, @rdy, I can try to do the up-front work to create a new organization and prep for the transfer.

@amilligan
Copy link
Collaborator Author

@thewoolleyman That sounds like a good plan to me.

Adam Milligan added 2 commits August 29, 2022 12:50
Authored-by: Adam Milligan <adam@redish.com>
ActiveSupport has deprecated passing a format identifier to #to_s for
date and time types.  Prior to 7.0.7 calling #to_s with no parameters
would use the `default` format, and the YAML processor calls #to_s on
all fields when dumping content.  FixtureBuilder was setting the
`default` format to the ISO8601 format that the database expects, which
caused the YAML processor to use that content.

As of version 7.0.7 ActiveSupport no longer allows calling #to_s without
parameters on date/time types if a default option is set.  However, the
standard default for Date formats is ISO8601, so FixtureBuilder does not
need to set the default format.  By leaving it unset the YAML dump does
not trigger the deprecation warning, and the resulting formatted strings
are still valid for Postgres.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants