Grails Fixtures alternative - grails

Could someone advice a good alternative to the grails fixtures plugin
It seems that the plugin project is not active any more, doc page shows 404 no recent commits and etc. Moreover, the plugin works buggy with new versions of grails (3.3.5).
We are using fixtures to initialize data for dev and test environments. And we like the concise way of defining entities and their many-to-many associations in bootstrap, which provides fixtures plugin.
So, any suggestions are welcome.
Thx.

Related

Is there a straight-forward way of doing an ORM roundtrip workflow in Grails 3+?

For the last few years I have been a Symfony developer and one of the things I enjoy the most is the fact that I don't have to write/maintain entities by hand.
Through Doctrine (the integrated ORM) I can extract the table metadata and relations through
php app/console doctrine:mapping:import SomeBundle yaml
And then I can generate the ORM entity classes
php app/console generate:doctrine:entities SomeBundle
And I'm friggin' done.
Need to migrate?, no problem. Use this command to create a migration:
doctrine:migrations:diff
And the following to migrate to it:
doctrine:migrations:migrate
For Grails, it seems that there is no straight forward way, unless I go and download the Hibernate tools and a tool like Liquibase.
There seem to be a couple of plugins that did this, but the one for reverse engineering from a database does not seem supported for Grails 3 (db-reverse-engineer) and the one for migrations I tried, but does not seem stable enough (database-migration).
Am I just looking in the wrong place?, if not, how do you as a professional Grails developer solve these needs?
No there is not a straight forward way to make a "round-trip" as you describe in Grails 3.x.
Most plugins aren't going to be 3.x ready yet. 3.x is still quite new.
That said, the reverse engineering plugin isn't designed to be a fully automated one-shot handles everything type of plugin. It's suppose to be a running start that you take the last bit by hand.
The migration plugin on the other hand is fully production ready and very stable in 2.x.

Extensions for Doctrine ORM

I'm working on a PHP project and evaluating Symfony 2 + Doctrine ORM. Coming back to PHP from Ruby on Rails, I'm wondering if there are parallels for the acts_as-style ActiveRecord plugins that are available all over GitHub for common behaviours in Rails.
Doctrine itself only has a few standard extensions for Translatable, Tree, Sluggable, and Timestampable. I was able to find a few other items on GitHub.
I'm looking for things like sortable lists, some implementation of soft-delete, state machines, file attachments (images), and so on. Is anything similar available or is it a roll-your-own ecosystem? Where can I find more resources?
You can look at https://github.com/l3pp4rd/DoctrineExtensions, there's some awesome extensions!

Ruby on Rails equivalent for Maven Archetypes

Maven Archetypes are handy ways to get a project up and going in no time flat. Rails is kinda like an archetype in and of itself. However, I'm curious to know if there are any Rails equivalents for Maven Archetypes.
For example, I want to create an Archetype with full authentication already built in via Authlogic. With Maven Archetypes I would need to build a project with it already ready to go, create my archetype and start working back parameterizing things that should be parameterized. Then anyone can make a Rails project with Authlogic set up by filling out a few questions during the archetype generate command and boom! Fully functional Rails app with Authlogic built in.
Is there a Rails Equivalent? Are Generators expected to do this? Is this just not Rails-y?
I think that rails app templates are the most similar thing to Maven Archetypes. http://railscasts.com/episodes/148-app-templates-in-rails-2-3 is a good starting point to get an opinion about them.
Perhaps you are looking for Modules and Mixins?
I'm not sure but rails casts might have something else to add.

How to create a project template for Ruby on Rails projects?

When I build Rails applications I find myself doing the same things over and over again. This includes adding the same gems/plugins, configuration info and custom initializers, rake tasks etc... etc....
This can't be a good thing.
So, is there a way to package all this repetitive code into some sort of project template ... so that I can do a "rails myapp" and have everything good to go from there?
Btw, running 2.3.5 if that matters :)
thanks
App templates is probably the feature you are looking for.
Many people just create the "template" and then commit it to a repository, possibly on GitHub, for easy access later. I personally find that this works really well.

Integrate test process with Rspec and Cucumber in a plugin using Desert

I'm developing some rails plugins with desert, and I would like to use tests with RSpec and Cucumber in the development. RSpec is integrated by default in Desert plugins, but it gives me some bugs.
Finally I have created a minimal application which use my plugin, and I try to test it like a normal application without plugin. But I dislike that solution, the plugin lost its modularity, and RSpec still returns me some bugs (he can't find the models/views/controllers located in the plugin...).
So am I the only one who try to test a Desert plugin (or even in a classic plugin) ? May anyone know those matters and get a solution ?
I was working with 'Desert' plug-ins in a legacy Rails 2.2.2 app and the following helped me http://pivotallabs.com/users/joe/blog/articles/985-testing-desert-plugins-in-isolation
You should not use desert plugin, it's an 'old thing'.

Resources