LTSINSCRIP-168 - Check for user type added to reservation creation.

Prior, any user could reserve any asset, regardless of type.

This change WILL NOT alter existing reservations.  You can check for bad data using this SQL:

SELECT DISTINCT r.id FROM reservations r
 WHERE NOT EXISTS (SELECT *
                   FROM (SELECT utu.user_type_id
                           FROM reservations r2
                           JOIN user_types_users utu
                             ON r2.user_id = utu.user_id
                          WHERE r2.id = r.id) a
                   INNER JOIN (SELECT ratut.user_type_id
                                 FROM reservations r3
                                 JOIN reservable_assets ra
                                   ON r3.reservable_asset_id = ra.id
                                 JOIN reservable_asset_types_user_types ratut
                                   ON ra.reservable_asset_type_id = ratut.reservable_asset_type_id
                                WHERE r3.id = r.id) b
                   ON a.user_type_id = b.user_type_id);

or, from the rails console, this code:

bad_data = []
Reservation.includes(:user => :user_types, :reservable_asset => {:reservable_asset_type => :user_types}).all.each do |r|
  allowable = r.reservable_asset.reservable_asset_type.user_type_ids
  actual = r.user.user_type_ids

  if actual.select {|type| allowable.include? type}.count == 0
    bad_data << r
  end
end