- Support for many-to-many and one-to-one-through associations (via
- Support for UUID as PKs in associations (via
- Relations without PKs should work too (via
- Relations with PK values generated on the Ruby side should work in SQlite too (via
- Support for one-to-one associations (@ianks)
- [internal] cache for Faker constants (@flash-gordon)
- Support for plural Faker generators (@wuarmin)
- [BREAKING] attributes are always passed as keywords (@alassek) This may affect your code in places where attributes are passed as hashes. Places like
user_attributes = { name: 'Jane' }
Factory[:user, user_attributes]
must be updated to
user_attributes = { name: 'Jane' }
Factory[:user, **user_attributes]
- Upgraded to the latest versions of dry-rb dependencies, compatible with rom 5.3 (@flash-gordon)
- Support for Faker 1.x was dropped (@alassek)
- Fix more keyword warnings (@flash-gordon)
- Support for faker 2 (@ianks)
- Keyword warnings reported by Ruby 2.7 (@flash-gordon)
-
struct_namespace
option is supported by factory builders (@graceful-potato)factories.define(:user, struct_namespace: MyApp::Entities) do |f| # ... end
- Support building structs when child assoc does not define parent (@psparrow)
- Fixed
TupleEvaluator#struct_attrs
for non-standard output schema (@AMHOL)
- Attributes of a struct are no longer accidentally passed to their associations (@psparrow)
- When attributes hash includes unknown attributes, a
ROM::Factory::UnknownAttributeError
will be raised (@rawburt)
- Loaded association structs are no longer rejected by output schemas (issue #34) (flash-gordon + solnic)
- Support for traits (v-kolesnikov)
- Support building structs with associations (@ianks)
- Overwritten attributes with dependencies (JanaVPetrova)
- Support for factories with custom struct namespaces (solnic)
- Using dependent attributes with sequences works correctly, ie
f.sequence(:login) { |i, name| "name-#{i}"}
(solnic)
- Accessing a factory which is not defined will result in
FactoryNotDefinedError
exception (GustavoCaso + solnic)
- Updated to rom 4.0 (solnic)
- Support for
has_many
andhas_one
associations (solnic) - Support for attributes depending on values from other attributes (solnic)
- Support for
rand
inside the generator block (flash-gordon)
- Depends on
rom-core
now (solnic)
improves internals.
- Support for defining multiple factories via
MyFactory = ROM::Factory.configure { |c| ... }
(solnic) - Support for builder inheritence via
define(admin: :user) { |f| ... }
(solnic) - Support for generating in-memory structs via
MyFactory.structs[:user]
that are not persisted (solnic) - Support for
belongs_to
associations viaf.association(:user)
(solnic) - New DSL for defining builders
MyFactory.define(:user) { |f| ... }
which infers default relation name (solnic) - New factory method
MyFactory#[]
ieMyFactory[:user, name: "Jane"]
(solnic) - New
fake
helper which uses faker gem under the hood ief.email { fake(:internet, :email) }
(solnic)
Rom::Factory::Config.configure
was replaced withROM::Factory.configure
(solnic)- Global factory config and builders are gone (solnic)
- Structs are now based on dry-struct (solnic)