
Allow has 1 fk to be a primary key without another key on Model
Reported by Will Prater | June 11th, 2008 @ 02:03 AM
It would be nice to allow has 1 to create a fk that would act as the only key for the Model. No need for a serial or other key for that model like so:
class Workout
include DataMapper::Resource
has 1, :user
property :user_id, Integer, :key => true
- Prefer not to use the below serial key
- property :id, Integer, :serial => true
property :data, Text
property :created_at, DateTime
end
Comments and changes to this ticket
-
Jonathan Stott (namelessjon) November 30th, 2008 @ 07:56 AM
- Tag set to dm-core
- State changed from new to invalid
- Assigned user cleared.
This can be done with Workout.belongs_to :user, if desired.
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.
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
- Nobody is watching this ticket.