#1519 new
Fred Kelly

Access Object from Custom Type

Reported by Fred Kelly | July 19th, 2011 @ 03:18 PM

Hi There,

I'm writing a very simple custom data type to be used in a couple of models for the project I am working on. The type extends Float and is basically designed to store weights in different unit measurements (kg, lb, st etc.) based on the user's preference. My User model has an Enum property which determines which units they want to use. I am trying to access this property from the custom type so that the output is given in the format the user has specified.

I have attached the code I have so far so you can see what I am trying to do. All of the models in which I am using this attribute belong_to a User, thus the user can be read via self.user from within the model.

Thanks for your help.

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