Skip to content

Commit

Permalink
Support only activeresource >= 3.1.0
Browse files Browse the repository at this point in the history
* Fixed Mite::Tracker for activeresource >= 3.1.0; fixes #9
* From now on only support activeresource >= 3.1.0
  • Loading branch information
yolk committed Dec 11, 2012
1 parent 9a7b47f commit a4932a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/mite/tracker.rb
Expand Up @@ -3,13 +3,13 @@ class Mite::Tracker < Mite::Base
self.collection_name = "tracker"

def self.current
tracking_time_entry = connection.get(collection_path, headers)["tracking_time_entry"]
tracking_time_entry = (format.decode(connection.get(collection_path, headers).body) || {})["tracking_time_entry"]
tracking_time_entry ? instantiate_record(tracking_time_entry) : nil
end

def self.start(time_entry_or_id)
id = time_entry_or_id.is_a?(Mite::TimeEntry) ? time_entry_or_id.id : time_entry_or_id
self.new(:id => id).start
new({:id => id}, true).start
end

def self.stop
Expand Down
2 changes: 1 addition & 1 deletion mite-rb.gemspec
Expand Up @@ -19,6 +19,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_runtime_dependency(%q<activeresource>, [">= 2.3.14"])
s.add_runtime_dependency(%q<activeresource>, [">= 3.1.0"])
end

0 comments on commit a4932a5

Please sign in to comment.