Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Easily upload CSV files based on your model definition.
Ruby
tree: ce53eab252

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
.document
.gitignore
LICENSE
README.markdown
Rakefile
VERSION
init.rb
install.rb
uninstall.rb

README.markdown

Commissionaire

Used to add class methods to your ActiveRecord class to collect data into your application.

Usage

To define a new collector all you need to do is define a collects method.

class Customer < ActiveRecord::Base
  collects(:full_customers)
end

You can then collect customers from a csv file.

Customer.collect_full_customers :filename => "#{RAILS_ROOT}/customer.csv"

or from a csv string

Customer.collect_full_customers :csv_string => %{id,first_name,last_name\n23,Tom,Smith}

TODOs

  1. add option to not save the collected data
  2. separate the import/mapping logic into separate class for testing
  3. create option to disseminate data is format provided
  4. create a method for converting csv headers to nested structure
  5. handle associations with the nested structure
  6. look at batch/bulk updates with AR
  7. look at disseminating(exporting) the data

Copyright

Copyright (c) 2009 Richard Outten. See LICENSE for details.

Something went wrong with that request. Please try again.