Skip to content

Instantly share code, notes, and snippets.

@mattjmorrison
Created April 25, 2013 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattjmorrison/5463125 to your computer and use it in GitHub Desktop.
Save mattjmorrison/5463125 to your computer and use it in GitHub Desktop.
Nice CoffeeScript refactor....
#Before
canModify: Ember.computed ->
value = false
description = @get('content.statusDescription')
if description is 'Unsent' or description is 'Do Not Send'
value = true
value
#After
canModify: Ember.computed ->
@get('content.statusDescription') in ['Unsent', 'Do Not Send']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment