
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
A component to auto generate seed data with ActiveRecord using a set of predefined or custom rules respecting models validations.
gem 'auto-seeding'
(better in development group)auto_seeding = AutoSeeding::Seeder.new
3.times.each do
auto_seeding.update( Author.new ).save!
end
Conf file: see data folder
Global options (shared between instances):
AutoSeeding::Seeder.config({
skip_associations: [:versions],
conf: {
seeder: :ffaker,
},
})
Instance options:
autoseeding = AutoSeeding::Seeder.new({
auto_create: [:profile], # array of symbols
conf: {
file: 'test/conf.yml', # string
seeder: :faker, # symbol - :faker or :ffaker
},
ignore_attrs: [:id], # array of symbols - ignored attributes
skip_associations: [:author], # array of symbols - ignored nested associations
sources: { # hash - keys: types, fields
types: { # hash - override basic types rules
integer: {
source_model: 'Random',
source_method: 'rand',
source_args: '0..100',
}
},
fields: [ # array of hashes - override fields rules
{
in: ['name'],
source_model: 'Faker::StarWars',
source_method: 'character',
type: 'string'
},
{
regexp: '^(.+_|)title(|_.+)$',
source_model: 'Faker::Book',
source_method: 'title',
post_process: '->( val ) { val + " (seeding)" }',
type: 'string'
}
]
}
})
Generated data can be manipulated easily before saving:
obj = auto_seeding.update( Author.new )
obj.name = 'John Doe'
obj.save!
Field names can be changed using append and prepend options - example using Carrierwave remote url property:
AutoSeeding::Seeder.new({
sources: {
fields: [
{
regexp: '^(.+_|)photo(|_.+)$|^(.+_|)image(|_.+)$',
source_model: 'Faker::Avatar',
source_method: 'image',
prepend: 'remote_',
append: '_url',
type: 'string'
}
]
}
}
To avoid problems with PaperTrail use:
AutoSeeding::Seeder.config({ skip_associations: [:versions] })
If you use this component just star it. A developer is more motivated to improve a project when there is some interest.
FAQs
Unknown package
We found that auto-seeding demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.