Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
277 B

module GenerateCsv
extend ActiveSupport::Concern
class_methods do
def to_csv
CSV.generate(headers: true) do |csv|
csv << self.attribute_names
all.each do |record|
csv << record.attributes.values
end
end
end
end
end