Skip to content

Commit

Permalink
Replaced .count and .length with .size (publiclab#8382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sethpony authored and wichanart committed Oct 26, 2021
1 parent daceac0 commit 42f3e07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def profile
@twitter = @profile_user.social_link("twitter")
@facebook = @profile_user.social_link("facebook")
@instagram = @profile_user.social_link("instagram")
@count_activities_posted = Tag.tagged_nodes_by_author("activity:*", @profile_user).count
@count_activities_attempted = Tag.tagged_nodes_by_author("replication:*", @profile_user).count
@count_activities_posted = Tag.tagged_nodes_by_author("activity:*", @profile_user).size
@count_activities_attempted = Tag.tagged_nodes_by_author("replication:*", @profile_user).size
@map_lat = nil
@map_lon = nil
@map_zoom = nil
Expand Down Expand Up @@ -424,7 +424,7 @@ def subscribe_multiple_tag(tag_list)
tag_list = tag_list.split(',')
end
tag_list.each do |t|
next unless t.length.positive?
next unless t.size.positive?
tag = Tag.find_by(name: t)
unless tag.present?
tag = Tag.new(
Expand All @@ -442,7 +442,7 @@ def subscribe_multiple_tag(tag_list)
end
end
# test for uniqueness
unless TagSelection.where(following: true, user_id: current_user.uid, tid: tag.tid).length.positive?
unless TagSelection.where(following: true, user_id: current_user.uid, tid: tag.tid).size.positive?
# Successfully we have added subscription
if Tag.find_by(tid: tag.tid)
# Create the entry if it isn't already created.
Expand Down

0 comments on commit 42f3e07

Please sign in to comment.