can't convert String into Integer (Mogli, lib/mogli/user.rb:113:in `[]')

10 views
Skip to first unread message

Oldřich Vetešník

unread,
Aug 26, 2011, 8:39:40 AM8/26/11
to facebooker, de...@planetofwinners.cz
Hello,

I was told you might be able to help me with this issue: we use Mogli
in our Rails application and once in a while we get this error
reported:

<pre>
can't convert String into Integer
mogli (0.0.27) lib/mogli/user.rb:113:in `[]'
</pre>

The problem is we have no idea how to reproduce this error, even how
it happens - whether it is on our side or your side or Facebook's
side. All we can give you is the top part of the backtrace:

<pre>
mogli (0.0.27) lib/mogli/user.rb:113:in `[]'
mogli (0.0.27) lib/mogli/user.rb:113:in `fetch_permissions'
mogli (0.0.27) lib/mogli/user.rb:112:in `each'
mogli (0.0.27) lib/mogli/user.rb:112:in `fetch_permissions'
mogli (0.0.27) lib/mogli/user.rb:95:in `has_permission?'
app/views/games/_finished_game_options.html.erb:32:in
`_app_views_games__finished_game_options_html_erb___331147463_40777860_6764748'
actionpack (3.0.7) lib/action_view/template.rb:135:in `send'
actionpack (3.0.7) lib/action_view/template.rb:135:in `render'
... more Rails backtrace
</pre>

I thought of a possible fix, but I am not sure if it's a really a fix,
more like a monkey patch.

<pre>
ALL_EXTENDED_PERMISSIONS.each do |perm|
@extended_permissions[perm] = (perms_query_result[perm.to_s] == 1
rescue false) # added rescue false
end
</pre>

I also found a GitHub repo https://github.com/mmangino/mogli but
didn't find this issue over there. Please let me know if I should post
there, not here.

Thank you,
Ollie
Reply all
Reply to author
Forward
0 new messages