Project

swim

0.0
No commit activity in last 3 years
No release in over 3 years
Sync or Swim
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
 Project Readme

Swim

Swim provides tools for synchronizing a tree of ActiveRecord objects with a previously-saved JSON file.

Installation

Add this line to your application's Gemfile:

gem 'swim'

And then execute:

$ bundle

Or install it yourself as:

$ gem install swim

Usage

  1. Add a settings_file instance method to your ActiveRecord class.

    class Artist < ActiveRecord::Base
      def settings_file
        File.expand_path("/sample_files/artist_1_settings.json")
      end
    end
  2. Add a sync_settings class method to your ActiveRecord class.

    class Artist < ActiveRecord::Base
      def self.sync_settings
        { :albums => {} }
      end
    end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request