David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
David Kimura PRO said over 5 years ago on Tracking Javascript Errors :
  I would probably use the environment option which you can create a metatag on the layout with the Rails.env and fetch this to set it in the Sentry init. https://docs.sentry.io/platforms/javascript/configuration/options/#environment


David Kimura PRO said over 5 years ago on Tracking Javascript Errors :
  I started including that only on the free episodes. It won't be on the Pro episodes anymore.

David Kimura PRO said over 5 years ago on User Notifications :
  ruby object and instantiating it in the comment controller create action

def create
  @comment = Comment.new(comment_params)
  if @comment.save
    CommentNotifier.call(@comment)
    ...
  else
    ...
  end
end

From there, you can make the Comment Notifier have guard clauses, do any checks and pass in any other additional parameters needed. (like passing in the current user to have a guard clause return unless current_user == comment.user) to prevent the current user getting a notification if they reply to their own comment.

David Kimura PRO said over 5 years ago on ActiveRecord Tricks :
  add a bang to User.create

User.create! do |user|
 ...
end

This won't fix the problem, but will fail and you can see what the error is.

David Kimura PRO said over 5 years ago on ActiveRecord Tricks :
You probably have some other association on the user (belongs_to) which is causing the user to not save.