Skip to content

Commit

Permalink
refactor asset export and add team notes [#807]
Browse files Browse the repository at this point in the history
  • Loading branch information
vegantech committed Dec 15, 2014
1 parent 76cee2f commit fcf3ed4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/district_export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,19 @@ def intervention_definition_assets
district.intervention_definitions.collect(&:assets)
end


def export_asset_sql
[
:probe_definitions,
:intervention_definitions,
:student_comments
].collect { |asset|
district.send(asset).joins(:assets).select("assets.*").to_sql
}.join(" UNION ")
end

def export_assets
generate_csv('assets',Asset.column_names.join(","),Asset.where(:id => district_asset_ids).to_sql)
generate_csv('assets',Asset.column_names.join(","),export_asset_sql)
end

def export_content_assets
Expand Down

0 comments on commit fcf3ed4

Please sign in to comment.