vendredi 21 septembre 2018

How to create association in rails, based on condition, from parent object

Need create association in rails based on condition from parent object, like

class User < ActiveRecord::Base
  has_many :versions

here how to mention, that User must have versions, only if user is a super_admin(for example)

Aucun commentaire:

Enregistrer un commentaire