Simplify a number of object model methods

This commit is contained in:
Tom Hughes 2013-12-05 00:50:04 +00:00
parent 1f52e5227f
commit 8c029f8d79
6 changed files with 11 additions and 66 deletions

View file

@ -147,13 +147,7 @@ class Relation < ActiveRecord::Base
end
def tags
unless @tags
@tags = Hash.new
self.relation_tags.each do |tag|
@tags[tag.k] = tag.v
end
end
@tags
@tags ||= Hash[self.relation_tags.collect { |t| [t.k, t.v] }]
end
def members=(m)