flat_errors_onworks again on virtual fields
- Add ability to disable "tagged" not found errors in
Repo.fetch/2and friends (local to calls or global option). - Added
BitcrowdEcto.FixedWidthInteger - Allow
Repo.advisory_xact_lock/1 to handle atoms
- Ensure field/assoc/embed exists when listing errors in
flat_errors_on/3. This prevents accidental test passes on typos in assertions likerefute_errors_on(cs, :sommtypo).
No changes from v0.17.0.
- Add
BitcrowdEcto.Changeset.cast_all/3, a introspection-based automatic cast function. - Add
BitcrowdEcto.Assertions.assert_cast_error_on/2.
- Allow any type of
idparam inRepo.fetch/2. Remove the (incorrect) guard restricting theidparam to binaries, against the spec saying it would allowany. - Handle missing schemas gracefully in
Migrator.ensure_up!/0.
- Convert
Ecto.Query.CastErrorinRepo.fetch_by/3& friends to:not_founderrors. Opt-out viaraise_cast_erroroption.
- Give
Repo.fetch_by/2,Repo.count/1, andAssertions.assert_count_difference/4an optionaloptsparameter that is forwarded to the underlying Ecto function. Useful to pass query options like:prefix.
- Changed
Repo.fetch/2andRepo.fetch/3to work with primary key with name other thanid.
- Add
error_tagoption toBitcrowdEcto.Repo.fetch_by/3and friends to allow overriding the queryable in the error result.
- Fix dependency specifications by restoring the
:onlyoptions and explicitly listing conflicting packages. See kipcole9/money#142 for explanation.
NOTE: 0.13.0 needed to be retired due to a corrupt dependency tree listing all dev/test dependencies as prod dependencies.
- Add
BitcrowdEcto.Changeset.validate_money/3for validatingMoneyvalues fromex_money, which is introduced as an optional dependency.
- Add
BitcrowdEcto.DateTime.beginning_of_month/1. - Add
BitcrowdEcto.DateTime.beginning_of_last_month/1. - Add
BitcrowdEcto.DateTime.beginning_of_next_month/1. - Add
BitcrowdEcto.DateTime.beginning_of_yesterday/1. - Add
BitcrowdEcto.DateTime.beginning_of_tomorrow/1.
- Add
BitcrowdEcto.Changeset.validate_date_after/3Validates a date field in the changeset is after the given reference date. - Add
BitcrowdEcto.Changeset.validate_hex_color/2validates a changeset field has hexadecimal color format. - Add
BitcrowdEcto.Assertions.assert_changeset_valid/1. - Add
BitcrowdEcto.Assertions.refute_changeset_valid/1.
- New
BitcrowdEcto.Assertions.assert_*_constraint_on/2matchers assert on constraints on changesets without going to the database. - Add
BitcrowdEcto.DateTime.shift/2andBitcrowdEcto.DateTime.beginning_of_day/1.
- BREAKING: Stopped
inspecting thefrom/tofields invalidate_transition/3error details. Previously atom columns (e.g. fromEcto.Enum) would result in[from: ":foo", to: ":bar"]error details, now these atoms are inserted unchanged as[from: :foo, to: :bar] - BREAKING: Removed
:fieldfromvalidate_transition/3error details as it is redundant with the error field. - Deprecated
BitcrowdEcto.Assertions.assert_foreign_constraint_error_on/2in favour of newassert_foreign_key_constraint_error_on/2. Constraint assert functions are all called after theEcto.Changeset.*_constraintfunctions now, not after internal error type names.
-
Add
BitcrowdEcto.Assertions.assert_change_to_almost_now/2to assert that the value of a datetime field changed to the present time. -
Add
BitcrowdEcto.Schema.to_enum_member/3andBitcrowdEcto.Schema.to_enum_member!/3, functions that safely convert a string to the member of an enum based on reflection on the given schema.
- BREAKING: Add
:only_weboption toBitcrowdEcto.Changeset.validate_email/3that enforces a dot in the host part of the email address (e.g.foo@example.netis valid,foo@exampleis not). Defaults to true.
- BREAKING: Drop the
BitcrowdEcto.Migration.grant_dml_privileges_on_schema/2variant that reads from a configuration variable. However, the keyword list ongrant_dml_privileges_on_schema/3has become optional, so effectively there is a different/2now.
- Add
BitcrowdEcto.Migrationfor migration utilities, first util isgrant_dml_privileges_on_schema/2thatGRANTs certain privileges to a Postgres role.
- Add
BitcrowdEcto.Randomcontaining various random token generators. - Add
validate_past_datetime/3,validate_future_datetime/3,validate_datetime_after/4,validate_date_order/4,validate_datetime_order/4andvalidate_order/5toBitcrowdEcto.Changeset.
- Add
Migrator.ensure_up!/0to check whether all migrations are up.
- Add
handle_migrator_exception/2callback toMigratorto allow exception reporting.
- Add missing
assert_sorted_equal/3.
- Add
assert_almost_now/1,assert_almost_coincide/3andassert_sorted_equal/2toBitcrowdEcto.Assertions.
- Add
BitcrowdEcto.DateTime.in_seconds/1.
Initial release to the public 🎉