Activity
Posted in RAILS SIDEKIQ SCHEDULER
I would suggest creating a worker that checks the status, and if the status is not completed, it schedules a copy of itself to run 5.seconds.from_now
. That way it can continuously keep checking and spawning new workers as needed until it's complete, or you've hit a timeout length or something.
Don't know when it's automatic, but yes it is a % payout for life (of the subscription).
10k ActionCable connections.
Posted in Team tracking?
Absolutely. I haven't had time to work on improving the team functionality a whole lot, but that's something I should do soon. Not enough time in the day!
Yep, you'd have to configure an SMTP server to send real emails.
Posted in Error when running in Test Env
So it says it can't authenticate:
SSHKit::Runner::ExecuteError: Exception while executing as test01@13.76.1.66: Au thentication failed for user test01@13.76.1.66
You'll want to make sure that your username, IP, and password / ssh key are correct. Sometimes you have to run "ssh-add -K" on a mac to add your ssh keys to the agent so that it uses the right key without having to manually specify it.
Whatever the issue is, it's just a misconfigured authentication somewhere.
My personal favorite was Metaprogramming Ruby. It explains how metaprogramming works which is ActiveRecords generates methods based upon the columns that are in each table in the database. That is the "magic" that most people don't understand in Rails. It's just standard Ruby, applied in smart ways.
Been planning on doing that soon. Thinking about doing this in a series where we create an embeddable Javascript comment system like Disqus.
My friend at Airbnb is hiring as well. His team is working specific on accessibility. Here's a generic job description for anyone interested: https://www.airbnb.com/careers/departments/position/2192
Posted in Why Wistia?
Hey James,
I think it should be really easy. The APIs you only need if you need to get a list of videos that are hosted or something.
You can hack something really easy together by just taking an embed code for a video and just simply replacing the video ID with an attribute stored on your model.
A pseudocode example of embedding Vimeo in Rails dynamically:
<iframe src="http://vimeo.com/embed/<%= @video.vimeo_id %>"></iframe>
This is how I do it with Wistia. I just set the ID in my admin area for a new episode. The only time I use the Wistia API is to make that easier. I upload the video, then use the API to populate a select dropdown with the videos that are uploaded so I can search and find the ID quicker.
In the screencast, I just commented out the before_action so I could show the JSON it renders. You won't be able to access the URL directly unless you make the request with your token. You can use Postman to try it out, or just uncomment the doorkeeper before_action like I did.
Posted in JWT with Devise (App and API)
Hey Stephen, did you see the series on how to build an OAuth Provider in Rails? It integrates with Devise, it will generate JWTs for access tokens if you want, and you can use it with iOS and Android to provide a "Login with My App" process just like Twitter or Facebook which is cool.
Posted in rails generate devise:install hangs
Try running "spring stop" in the new app folder, delete the folder, and then try again. Spring will cache files like that and do weird things.
Sebastian, you can always build custom buttons for Trix to add those features.
Posted in Paypal & Stripe
Hey Brian,
Where's your confusion?
A webhook is sending you some JSON data, so you have to poke around through it to get what you want out (the amount in this case).
Your error says you called amount on a Stripe Subscription which doesn't have an amount, a plan does.
NoMethodError (undefined method `amount' for #Stripe::Subscription:0x00005630b03da5b8)
Print out your event in the terminal or byebug / pry it so you can see what data you've got.
Posted in Paypal & Stripe
You're calling charge.amount
on the stripe object you set just before with:
charge = event.data.object
Since that's a Subscription object, you can call methods on it for the attributes it has. This is not your model.
https://stripe.com/docs/api#subscription_object
As you can see, you can ask that object for the plan, and then the plan for the amount.
Posted in Paypal & Stripe
Looks like it doesn't support it directly, it must be nested inside an html
key. You can see under the "form_with options" header here: https://api.rubyonrails.org/v5.1/classes/ActionView/Helpers/FormHelper.html#method-i-form_with
Either way, that works fine though. 👍
Posted in Exporting Records To CSV Discussion
Yep, that's pretty normal for very large files. Generate it, store it somewhere that you can link to, and then either send them an email or display it on the website with a link to download. That's pretty standard to what you'd see in other apps.
Posted in Paypal & Stripe
Hey Brian,
So the existing card form shows up but it doesn't hide the new card form? Is that correct?
For some debugging, just print out the results of things like <%= current_user.card_last4? %>
to make sure it is true
. Then try just adding a simple like style: "background: blue"
to your form and make sure you've got that working. Then go swap it out with the conditional version, since you'll probably have discovered what's wrong then.
I love when that happens!