#10

Discarded

[Feature] Support attributes in get_desired_columns

Reported by Eden Brandeis on Ajax Scaffold · 14/04/2006 00:59:17

Assigned to:
Nobody
Priority:
Normal
Status:
Discarded
Category:
Feature Request
Version:
3.0.2

Sometimes it is necessary to hide a field behind an attribute and override the writer and reader methods. For example, a number might consist of two database fields (dollars & cents) that are meant to be edited in a single form using an facade column. Or a number is stored as a string, but should be treated as a number. In this case the following methods will accomplish this:

def vint

read_attribute(“vendor_number”).to_i
end

def vint=(integer_representation)

write_attribute(“vendor_number”, integer_representation.to_s)
end

Currently calling get_desired_columns for facade columns doesn’t work. get_desired_columns looks at the columns_hash for the model which doesn’t contain the facade column.

If possible, it would be nice to be able to specify that a facade column be displayed with real columns. It is easy to add the edit field to _form, but more difficult to add the facade column to the displayed fields.

Attachments Upload

No attachment has been uploaded, yet.


Loading comments...