Skip to content

before_validation :update_permalink, on: :create is never triggered in an hyper model #218

Closed
@lionelchauvin

Description

@lionelchauvin

This is a common pattern to initialize some attributes before validation on creation. For instance acts_as_permalink does that: https://github.com/kmcphillips/acts_as_permalink/blob/55e824a5bf76f30ce8250dd9438bc46234e25b45/lib/concern.rb#L10

But in hyperstack, a new_record is saved without validation and validated later:

record.check_permission_with_acting_user(acting_user, op).save(validate: false) || true

The callback is never triggered because validation is applied to a record that is already created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions