lib/db/sync.rb in db-sync-0.0.7 vs lib/db/sync.rb in db-sync-0.0.8
- old
+ new
@@ -7,10 +7,16 @@
module Db
# Databse Sync
class Sync
include ActiveSupport::Configurable
+ attr_accessor :sync_dir
+
+ def initialize(sync_dir = nil)
+ self.sync_dir = sync_dir || 'data'
+ end
+
def log
@log ||= []
end
def sync_up(commit = true)
@@ -114,10 +120,10 @@
end
end
def table_filename(table)
# TODO: change data with custom dir
- File.join(Rails.root || '.', 'db', 'data', "#{table}.yml")
+ File.join(Rails.root || '.', 'db', sync_dir, "#{table}.yml")
end
def configure
yield(config)
end