Skip to content

disruptive/swim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sync or Swim

Resources

License

Stars

Watchers

Forks

Packages

No packages published