#1078 ✓resolved

Document software (non-db) behavior of dm-constraints

Reported by bgentry | October 5th, 2009 @ 04:59 PM | in 0.10.2

The documentation does not explain the need to 'include DataMapper::Constraints' in a model in order to have DataMapper enforce the constraints on a software level (That is, without relying on the database constraints) so that constraints will still be enforced in non-FK databases like sqlite3.

Also, it may be helpful to explain how specifying a :destroy constraint should work for M:M relationships. Example:

class User
  has n, :group_users
  has n, :groups, :through => :group_users

class Group
  has n :group_users
  has n, :users, :through => :group_users

In the User class, where should the :destroy constraints be specified? On the intermediate :group_users model, or the final :groups model, or both? Docs seem to imply that both are necessary but should clarify this point.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Referenced by