0.0
No commit activity in last 3 years
No release in over 3 years
Adds a class method to all ActiveRecord models in Rails that exports all rows in a single CSV file to an Amazon S3 bucket
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
 Project Readme

export_to_cloud

export_to_cloud provides a simple way to export all rows of an ActiveRecord model in Rails to Amazon S3 as a time-stamped CSV file.

Usage

Require the gem

gem 'export_to_cloud'

Configure

Create an initializer in 'config/initializers' called something like 'export_to_cloud.rb'. Set the following config variables:

ExportToCloud.aws_access_key_id = "your_access_id"
ExportToCloud.aws_secret_access_key = "your_secret_key"
ExportToCloud.s3_bucket = "your_bucket_name"
ExportToCloud.path = "path/to/directory/in/bucket/"

Call

Call the method on any of your models, like so...

Person.export_to_cloud

I usually make this call in a cron job or manually via the console.

That's it!

To-do

Add some tests. If anyone has an idea how to pull if off, given the S3 integration, I'm all ears :)