Commit ea09f868c600eb897a2e9485122a3ceee3c442a9

Authored by Larissa Reis
1 parent 674b489a

sniffer: rails4 fix filtering of virtual attribute distance

  `sniffer_plugin_distance` is a virtual attribute of profile and seems
  like it can only be accessed by a get method call now, so I replaced a
  `[]` call by a send.
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
plugins/sniffer/lib/sniffer_plugin/helper.rb
... ... @@ -5,7 +5,7 @@ module SnifferPlugin::Helper
5 5 def filter_visible_attr_profile(profile)
6 6 filtered_profile = {}
7 7 visible_attributes = [:id, :name, :lat, :lng, :sniffer_plugin_distance]
8   - visible_attributes.each{ |a| filtered_profile[a] = profile[a] || 0 }
  8 + visible_attributes.each{ |a| filtered_profile[a] = profile.send(a) || 0 }
9 9 filtered_profile
10 10 end
11 11  
... ...