Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in Two-factor Authentication

Posted in Using Webhooks with Stripe Discussion

Actually, stripe_id on the User model references a Stripe::Customer's ID and stripe_id on a Charge references a Stripe::Charge's ID. That's a great point to clarify!

We're just storing references to the different objects in Stripe so we can load up those objects whether they're a Customer, a Charge, or a Subscription, etc.

Posted in Carrierwave file extension issue

In that case, you're gonna want to change your method for the filename to use .jpg instead of the original extension:

  def filename
    "#{secure_token}.jpg" if original_filename.present?
  end

You might want to add a conditional to do this only for a specific version (the one that you converted to jpg) and use the original extension as necessary for the rest.

Posted in Carrierwave file extension issue

What is your issue?

You have it set to only allow png's:

  def extension_whitelist
      %w(png)
  end

Posted in Passing name objects to Stripe

Hey Charles,

I'm pretty sure you want the description attribute and you can pass the user's name in there. https://stripe.com/docs/api/ruby#create_customer-description

If you write your Javascript using webpacker, it will use ES6 out of the box.

For the asset pipeline, there's a sprockets-es6 gem.

Posted in Error Tracking with Errbit Discussion

It asks for your repo so it can link you to the line of code that triggered the error.

And yes, any errors from environments mentioned in ignore, will be skipped.

Posted in Why is viewer_id 0 on every video?

You'll want to make sure you have your association setup for it

class Video
  belongs_to :viewer, class_name: "User"
end

And then your view can use that association to load the email:

<%= @video.viewer.email %>

Posted in Why is viewer_id 0 on every video?

Hey Michelle,

At a quick glance, you're setting the viewer_id in your form (which is a database integer column) but your form is submitting email addresses. You probably want to display email address but submit the value as the user's ID instead.

<%= f.select :viewer_id, options_for_select(@users.map{ |u| [u.email, u.id] })), class: 'form-control'  %>

If you pass in an array for each user of email and id like this example, it should show the email in the form field, but the ID will be the value actually submitted to the server. That should assign the correct value for you then instead of 0.

Posted in Different Notification Types By Type

I imagine they go through most of it, and then just schedule a background job to notify via mobile if it hasn't already been marked as sent. I'm not sure what their delay is but it's like 3 minutes or something for mobile.

Posted in Different Notification Types By Type

Someone at Slack posted this flowchart of the rules used to determine whether or not to send a notification:


Posted in Payments with Stripe Master Class

I would probably just install the Heroku CLI on Windows as well to solve that problem. Then you can access that from Windows until it's finally stable to run on the Linux subsystem.

Hey Robert,

When Stripe tells you that the customer doesn't have a card to charge, that means that your form probably hasn't submitted the stripeToken param to attach to the user. You'll want to make sure that's getting passed over.

Posted in Payments with Stripe Master Class

Yep, like I mentioned in the course, the new Stripe Elements code is the newest version of the Stripe Javascript. The old code is there for reference, but you can just use the Stripe Elements version and you will be all set. 👍

Let me know if you run into any troubles!

Posted in Tutorials on recommendation engines

Hey TL,

That's definitely a great suggestion and you're right, those recommendations engines aren't trivial.

I'd probably check out this gem first: https://github.com/davidcelis/recommendable

And if that didn't work out, I'd try building my own implementation. It seems most of these gems aren't too well maintained.

Posted in Coffeescript 2 Rails Asset Pipeline

Congrats Bijan! Thanks for your work on that! :D

Posted in Cross-platform rich text editing

You've probably got two options here:

  1. Build your own custom markdown parser so you can add in new features. You could use html-pipeline for this in Rails. That's what Github uses for their commenting. You'd have to come up with your own syntax for features like highlighting.
  2. Use an HTML editor like Trix, etc and build your own features out there. These typically have full HTML support so you're free to write as complicated of features as you want and you're not stuck with some simple formatting like Markdown. I would imagine an HTML editor would provide you with a whole lot more flexiblity going forward.

In either case, I'm sure you'll have to build custom plugins for your editor to pull off all the features you want. The thing I would recommend is to pick a complex feature or two and try it with both. Which solution makes it easiest and which do you see being most flexible for the inevitable changes in the future?

Posted in Hatch - Deployment - Server monitoring

Hey Sanjay,

At the moment, there isn't any monitoring but that's something that's on the todo list. Any specific monitoring you'd like to see?

First, keep it exactly the same. You want to make sure that every adjustment you make is going to be fine in production, so don't make any significant changes.

If it's minor versions of Ruby that are different, that's fine. They don't have to be perfectly the same. Gem versions matter a lot more.