Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Fixes syncing.
Browse files Browse the repository at this point in the history
Reintroduces environment variable for God, makes all methods public in
Resource model (Review) and refines update_sequence_number check.
  • Loading branch information
joegatt committed May 25, 2013
1 parent 0b91ba7 commit f0b8afd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/models/evernote_note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def syncdown_one
logger.info I18n.t('notes.sync.rejected.ignore', error_details)
undirtify

elsif cloud_note_updated?(cloud_note_metadata.updated)
elsif cloud_note_not_updated?(cloud_note_metadata.updateSequenceNum)
logger.info I18n.t('notes.sync.rejected.not_latest', error_details)
undirtify

Expand Down Expand Up @@ -125,8 +125,8 @@ def cloud_note_ignorable?(cloud_note_tags)
(!(Settings.evernote.instructions.ignore & cloud_note_tags).empty?)
end

def cloud_note_updated?(note_metadata_updated)
(note && note.update_sequence_number >= note_data.updateSequenceNum)
def cloud_note_not_updated?(cloud_note_data_update_sequence_number)
(note && update_sequence_number >= cloud_note_data_update_sequence_number)
end

def update_with_data_from_cloud(note_data)
Expand Down
2 changes: 1 addition & 1 deletion app/models/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def blank_location
File.join(Rails.root, 'public', 'resources', 'cut', "blank.#{ file_ext }")
end

private
# private

def make_local_file_name
if mime && mime !~ /image/
Expand Down
2 changes: 1 addition & 1 deletion script/daemons/sync_all.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#require ENV["RAILS_ENV_PATH"]
require ENV["RAILS_ENV_PATH"]
require File.expand_path(File.join(File.dirname(__FILE__), '../..', 'config', 'environment'))
require 'rubygems'

Expand Down

0 comments on commit f0b8afd

Please sign in to comment.