- Removes the
Rails.env
check in theTaggable
module.- This was a holdover from a previous project and shouldn't have been included here. We have
Penman.enable
andPenman.disable
for this stuff.
- This was a holdover from a previous project and shouldn't have been included here. We have
- Major change
- Adds support for custom seed file formatting via an
.erb.
file. RecordTag
is now wrapped in thePenman
module.seed_method_name
config setting has been removed as the erb solution is better.- add proper versioning
- pull request
- Adds
Penman.enabled?
- Adds configuration for the
file_name_formatter
method, allowing users to format their file names as they see fit. - Removes
Penman.seed_path
andPenman.default_candidate_key
as these can be easily accessed throughPenman.config.*
- pull request
- Fix bug for a case where a relation is defined between two models where the foreign key is not the primary key.
- Thanks to @jayvan for this fix.
- pull request
- Adds back a check printed in the seeds files that allow the seeds to be safely run in environments where they were generated.
- pull request
- Fix issue 5
- Generate the seed order tree at seed generation time, not when the models are loaded. The issue was caused when the
include Taggable
line in the model was above anybelongs_to:
association. When the module is included the model is registered and ordered via a tree with RecordTags. If thebelongs_to
relation isn't setup yet, this ordering can be incorrect. By generating the seed order at seed generation time, we allow the models time to be fully setup before evaluating their relations. - pull request
- Adds the
after_generate
configurable callback that is to be used to add generated seeds to a migrations table of the user's choice. - pull request
- Adds an optional record validity check prior to seeds.
- pull request
- Encode strings with
.inspect
, allowing for special characters in the strings to be escaped. - pull request
- relax rails constraint, allowing rails 5 apps to use the gem
- direct users to put the configuration in initializers
- pull request (thanks @nearlyfreeapps)
- Add functionality for generating seeds only for specific models (thanks @lyrebird)
- pull request