geetarista-export_csv 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.rdoc +10 -2
  2. data/lib/export_csv.rb +2 -2
  3. metadata +1 -1
data/README.rdoc CHANGED
@@ -1,11 +1,19 @@
1
1
  == export_csv
2
2
 
3
- Very simple tool to export all records of an ActiveRecord model
3
+ Very simple tool to export all records of an ActiveRecord model.
4
4
 
5
5
  == Examples
6
6
 
7
+ The only required parameter is the model name:
8
+
7
9
  export_csv(User)
8
- export_csv(User, "User Backup", { :limit => 10 })
9
10
 
11
+ The name of the generated file can be overriden by passing it as a second option:
12
+
13
+ export_csv(User, "User Backup")
14
+
15
+ Find options may also be passed
16
+
17
+ export_csv(User, "User Backup", { :limit => 20 })
10
18
 
11
19
  Copyright (c) 2009 Robby Colvin, released under the MIT license
data/lib/export_csv.rb CHANGED
@@ -1,6 +1,6 @@
1
- def export_csv(klass, filename=klass, conditions="")
1
+ def export_csv(klass, filename=klass, conditions={})
2
2
  require 'ruport'
3
- records = klass.find(:all, :conditions => conditions)
3
+ records = klass.find(:all, :options => options)
4
4
  headers = klass.columns.collect{ |a| a.name }
5
5
  data = []
6
6
  records.each do |r|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geetarista-export_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robby Colvin