Send email asynchroniously using Sidekiq.
Create your mailer us usual:
| class ApplicationController < ActionController::API | |
| before_action :authenticate_user_from_token! | |
| def authenticate_user_from_token! | |
| auth_token = request.headers['Authorization'] | |
| auth_token ? authenticate_with_token!(auth_token) : authentication_error | |
| end | |
| def authenticate_with_token!(token) | |
| unless token.include?(':') |
🔔 NOTE: If you can, please buy software license to support the authors/developers!
Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.
If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3
HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.
Follow along...
| class CreateGadgets < ActiveRecord::Migration | |
| def change | |
| create_table "gadgets" do |t| | |
| t.json "info" | |
| end | |
| end | |
| end |
git log --oneline -1 <PR-BRANCH>git push -f origin :| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps.
Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:
bin/rails db:version) is 0.For a "normal" app that usually means it will run the DB migrations.