Skip to content

Instantly share code, notes, and snippets.

@r00k
Last active April 3, 2016 10:53
Show Gist options
  • Save r00k/28d2ec356192da9a192d to your computer and use it in GitHub Desktop.
Save r00k/28d2ec356192da9a192d to your computer and use it in GitHub Desktop.
Quizzy Question 5

Answer to Question 4

detect makes things a little shorter:

widgets.detect { |widget| widget.size > 3 }

Question 5

See anything smelly in this code?

class Comment < ActiveRecord::Base
  after_create :deliver_email_notification

  private

  def deliver_email_notification
    Mailer.comment_notification(self).deliver
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment