has_many through output
anlek opened this issue · 0 comments
anlek commented
I'm trying to output something like this:
user have many custom_values
custom_values belong to custom fields
I want to export in a csv all the custom_values for all the custom_fields
Something like
class User < ActiveRecord::Base
has_many :custom_values
belongs_to :account
comma do
name
account.custom_fields.each do |cf|
custom_value :for => {:custom_field_id => cf.id}, :name => cf.name
end
end
end
Any ideas on how I can achieve this?