Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Sync or Swim
Ruby Perl Shell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
LICENSE
README.md
Rakefile
swim.gemspec

README.md

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
Something went wrong with that request. Please try again.