clean up tags_count_out_of_limit
This commit is contained in:
@@ -47,12 +47,10 @@ class Debate < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tags_count_out_of_limit(limit = nil)
|
def tags_count_out_of_limit(limit = nil)
|
||||||
if limit
|
return 0 unless limit
|
||||||
count = tags.count - limit
|
|
||||||
count < 0 ? 0 : count
|
count = tags.count - limit
|
||||||
else
|
count < 0 ? 0 : count
|
||||||
0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
Reference in New Issue
Block a user