On Lunes, 28 de Septiembre de 2009 23:28:07 alexp escribió:
> singular associations also would be nice to have select_columns also,
> again improving the page load and resources
Rails doesn't support it, you can try it with script/console or look at rails
API. You can add another association (with other name) using the same
foreign_key, set select as an option in the association and use it in
active_scaffold instead of the other association (yeah, it's awful)
Adding support for it in ActiveScaffold will require duplicate find_target
method from HasOneAssociation and BelongsToAssociation proxy classes, and I
don't want to maintain that. If you find a easy way I can add support for it.
Another way to improve performance for those associations is overriding
get_column_value in your helper:
def get_column_value(record, column)
if column.name == :singular_association_with_many_fields
value = code_to_find
clean_column_value(format_value(value.try(:to_label)))
else
super
end
end
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---