## 0.12.0 2024-01-19 ### Added - Support for many-to-many and one-to-one-through associations (via - Support for UUID as PKs in associations (via ### Fixed - Relations without PKs should work too (via - Relations with PK values generated on the Ruby side should work in SQlite too (via [Compare v0.11.0...v0.12.0](https://github.com/rom-rb/rom-factory/compare/v0.11.0...v0.12.0) ## 0.11.0 2022-11-11 ### Added - Support for one-to-one associations (@ianks) - [internal] cache for Faker constants (@flash-gordon) ### Fixed - Support for plural Faker generators (@wuarmin) ### Changed - [BREAKING] attributes are always passed as keywords (@alassek) This may affect your code in places where attributes are passed as hashes. Places like ```ruby user_attributes = { name: 'Jane' } Factory[:user, user_attributes] ``` must be updated to ```ruby 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) [Compare v0.10.2...v0.11.0](https://github.com/rom-rb/rom-factory/compare/v0.10.2...v0.11.0) ## 0.10.2 2020-04-05 ### Fixed - Fix more keyword warnings (@flash-gordon) [Compare v0.10.1...v0.10.2](https://github.com/rom-rb/rom-factory/compare/v0.10.1...v0.10.2) ## 0.10.1 2019-12-28 ### Added - Support for faker 2 (@ianks) ### Fixed - Keyword warnings reported by Ruby 2.7 (@flash-gordon) [Compare v0.10.0...v0.10.1](https://github.com/rom-rb/rom-factory/compare/v0.10.0...v0.10.1) ## 0.10.0 2019-12-11 ### Added - `struct_namespace` option is supported by factory builders (@graceful-potato) ``` ruby factories.define(:user, struct_namespace: MyApp::Entities) do |f| # ... end ``` ### Fixed - Support building structs when child assoc does not define parent (@psparrow) - Fixed `TupleEvaluator#struct_attrs` for non-standard output schema (@AMHOL) [Compare v0.9.1...v0.10.0](https://github.com/rom-rb/rom-factory/compare/v0.9.1...v0.10.0) ## 0.9.1 2019-10-23 ### Fixed - Attributes of a struct are no longer accidentally passed to their associations (@psparrow) [Compare v0.9.0...v0.9.1](https://github.com/rom-rb/rom-factory/compare/v0.9.0...v0.9.1) ## 0.9.0 2019-08-12 ### Added - When attributes hash includes unknown attributes, a `ROM::Factory::UnknownAttributeError` will be raised (@rawburt) [Compare v0.8.0...v0.9.0](https://github.com/rom-rb/rom-factory/compare/v0.8.0...v0.9.0) ## 0.8.0 2019-04-24 ### Fixed - Loaded association structs are no longer rejected by output schemas (issue #34) (flash-gordon + solnic) [Compare v0.7.0...v0.8.0](https://github.com/rom-rb/rom-factory/compare/v0.7.0...v0.8.0) ## 0.7.0 2018-11-17 ### Added - Support for traits (v-kolesnikov) - Support building structs with associations (@ianks) ### Fixed - Overwritten attributes with dependencies (JanaVPetrova) [Compare v0.6.0...v0.7.0](https://github.com/rom-rb/rom-factory/compare/v0.6.0...v0.7.0) ## 0.6.0 2018-01-31 ### Added - Support for factories with custom struct namespaces (solnic) ### Fixed - Using dependent attributes with sequences works correctly, ie `f.sequence(:login) { |i, name| "name-#{i}"}` (solnic) ### Changed - Accessing a factory which is not defined will result in `FactoryNotDefinedError` exception (GustavoCaso + solnic) [Compare v0.5.0...v0.6.0](https://github.com/rom-rb/rom-factory/compare/v0.5.0...v0.6.0) ## 0.5.0 2017-10-24 ### Added - Updated to rom 4.0 (solnic) - Support for `has_many` and `has_one` associations (solnic) - Support for attributes depending on values from other attributes (solnic) - Support for `rand` inside the generator block (flash-gordon) ### Changed - Depends on `rom-core` now (solnic) [Compare v0.4.0...v0.5.0](https://github.com/rom-rb/rom-factory/compare/v0.4.0...v0.5.0) ## 0.4.0 2017-03-03 improves internals. ### Added - 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 via `f.association(:user)` (solnic) - New DSL for defining builders `MyFactory.define(:user) { |f| ... }` which infers default relation name (solnic) - New factory method `MyFactory#[]` ie `MyFactory[:user, name: "Jane"]` (solnic) - New `fake` helper which uses faker gem under the hood ie `f.email { fake(:internet, :email) }` (solnic) ### Changed - `Rom::Factory::Config.configure` was replaced with `ROM::Factory.configure` (solnic) - Global factory config and builders are gone (solnic) - Structs are now based on dry-struct (solnic)