Simplify a number of object model methods
This commit is contained in:
parent
1f52e5227f
commit
8c029f8d79
6 changed files with 11 additions and 66 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue