
Make column names accessible from DM::Base
Reported by Nick Plante | November 7th, 2007 @ 03:15 PM
drfreeze: How does one get a list of column names for a model?
[4:12pm] ReinH: drfreeze: currently, database.adapter.table(Model).columns.map(&:name)
[4:12pm] ReinH: drfreeze: I can see how that would probably be convenient to get to from DataMapper::Base though
Comments and changes to this ticket
-
Nick Plante November 12th, 2007 @ 03:20 PM
- State changed from new to open
- Milestone cleared.
-
Sam Smoot December 28th, 2007 @ 12:00 AM
- State changed from open to hold
Need to decide wether we're going to pursue the whole Property thing first... need to discuss.
-
Dan Kubb (dkubb) November 29th, 2008 @ 09:10 PM
- State changed from hold to invalid
Marking this as invalid, since there is no DM::Base any longer.
The current way to get a list of all the column names is:
Model.properties(repository_name).map { |p| p.field(repository_name) }
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 »