kandanapp / kandan

Kandan is an Open Source Alternative to HipChat
GNU Affero General Public License v3.0
2.72k stars 405 forks source link

undefined method `names' for Emoji:Module #402

Closed bodrovis closed 9 years ago

bodrovis commented 9 years ago

This error raises when you open the app (using master branch) at assets/javascripts/backbone/plugins/emojis.js.coffee.erb, line 5.

names method is no longer present in Gemoji, seems that it was lastly availble at 1.5.0 (https://github.com/github/gemoji/blob/v1.5.0/lib/emoji.rb#L8). Now there is all (https://github.com/github/gemoji/blob/master/lib/emoji.rb#L15) that returns all icons as objects and you can issue name against each of them. Therefore it can be fixed by replacing

<%= Emoji.names.to_s %>

with

Emoji.all.map {|e| e.name}.to_s

and that will generate an array of names. However I am not 100% sure that this is the desired output.

scouttyg commented 9 years ago

We've been needing to version our gems, so it might instead be helpful to just set Gemoji for version ~1.5, so that way we don't need to continue to update our app for changes.

Or, we could always update it to the latest Gemoji, and fix Kandan for that, but then version it at 2.1. Looking through the changelog, I don't see anything crazy we'd be missing by moving up to 2.1, do you?

scouttyg commented 9 years ago

I'll lock Gemoji at 1.5.0 for now and when we move over to Rails 4 we can upgrade accordingly :)

scouttyg commented 9 years ago

Should be ok to go now!

bodrovis commented 9 years ago

@scouttyg Yeah, this seems like a way to go