active_record_to_csv 0.1.0 → 0.1.1
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.
- data/README.rdoc +28 -0
- data/active_record_to_csv.gemspec +2 -2
- data/lib/active_record_to_csv/version.rb +1 -1
- metadata +4 -3
data/README.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
= ActiveRecord.to_csv
|
2
|
+
|
3
|
+
== Description
|
4
|
+
|
5
|
+
A simple ActiveRecord::Base to_csv() class method that preserves scopes.
|
6
|
+
to_csv() returns the entire contents including the header ready to be written to file.
|
7
|
+
|
8
|
+
== Usage
|
9
|
+
|
10
|
+
# Assuming a Movie model with title and director_id columns.
|
11
|
+
Movie.to_csv
|
12
|
+
# would return:
|
13
|
+
title,director_id
|
14
|
+
title,director_id
|
15
|
+
Black Swan,0
|
16
|
+
Inception,1
|
17
|
+
The Fighter,2
|
18
|
+
The King's Speech,3
|
19
|
+
The Kids Are All Right,4
|
20
|
+
|
21
|
+
Movie.bad.to_csv
|
22
|
+
# would return:
|
23
|
+
title,director_id
|
24
|
+
The Kids Are All Right,4
|
25
|
+
|
26
|
+
== TODO
|
27
|
+
|
28
|
+
Options to specify columns to be included (currently, id and timestamp columns are excluded).
|
@@ -9,8 +9,8 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["Jared Ning"]
|
10
10
|
s.email = ["jared@redningja.com"]
|
11
11
|
s.homepage = "https://github.com/ordinaryzelig/active_record_to_csv"
|
12
|
-
s.summary = %q{Simple ActiveRecordModel
|
13
|
-
s.description = %q{Simple ActiveRecordModel
|
12
|
+
s.summary = %q{Simple ActiveRecordModel to_csv() class method that preserves scopes}
|
13
|
+
s.description = %q{Simple ActiveRecordModel to_csv() class method that preserves scopes}
|
14
14
|
|
15
15
|
s.rubyforge_project = "active_record_to_csv"
|
16
16
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: active_record_to_csv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jared Ning
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
version: 1.2.5
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id003
|
49
|
-
description: Simple ActiveRecordModel
|
49
|
+
description: Simple ActiveRecordModel to_csv() class method that preserves scopes
|
50
50
|
email:
|
51
51
|
- jared@redningja.com
|
52
52
|
executables: []
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- .gitignore
|
60
60
|
- .rvmrc
|
61
61
|
- Gemfile
|
62
|
+
- README.rdoc
|
62
63
|
- Rakefile
|
63
64
|
- active_record_to_csv.gemspec
|
64
65
|
- lib/active_record_to_csv.rb
|
@@ -97,7 +98,7 @@ rubyforge_project: active_record_to_csv
|
|
97
98
|
rubygems_version: 1.5.2
|
98
99
|
signing_key:
|
99
100
|
specification_version: 3
|
100
|
-
summary: Simple ActiveRecordModel
|
101
|
+
summary: Simple ActiveRecordModel to_csv() class method that preserves scopes
|
101
102
|
test_files:
|
102
103
|
- spec/active_record_to_csv_spec.rb
|
103
104
|
- spec/schema.rb
|