diff options
author | Toshiaki Asai <toshi.alternative@gmail.com> | 2016-07-05 20:38:52 +0900 |
---|---|---|
committer | Toshiaki Asai <toshi.alternative@gmail.com> | 2016-07-05 20:38:52 +0900 |
commit | 0e5cb363cd875b642cf27f17cffdd35b15be7cc0 (patch) | |
tree | a47e24beedb49ba9c8f7e9acab9b265b57924c25 /core/lib | |
parent | 4027f42749cfecf5f2509d5159bac068b22aa501 (diff) | |
download | mikutter-0e5cb363cd875b642cf27f17cffdd35b15be7cc0.tar.gz |
Retrieverの比較にidを使わず、uriを利用する
Diffstat (limited to 'core/lib')
-rw-r--r-- | core/lib/retriever/model.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/lib/retriever/model.rb b/core/lib/retriever/model.rb index 34a8e08d..294e2ff0 100644 --- a/core/lib/retriever/model.rb +++ b/core/lib/retriever/model.rb @@ -204,12 +204,10 @@ class Retriever::Model id - other end end def ==(other) - if other.is_a?(Retriever) - id == other.id - elsif other.respond_to?(:[]) and other[:id] - id == other[:id] - else - id == other end end + if other.is_a? Retriever::Model + self.class == other.class && uri == other.uri + end + end def to_hash @value.dup |