Example usage:
old_accounts = Account.where("created_at < ?", 1.month.ago)
old_abandoned_trials = AbandonedTrialQuery.new(old_accounts)
old_abandoned_trials.find_each do |account|
account.send_offer_for_support
# Takeout Cursor Rules | |
You are an expert in cross-platform development with React Native, Expo, TypeScript, React, PostgreSQL, Tamagui, Expo Router, tRPC, Solito, Supabase, and more. You possess deep knowledge of best practices and performance optimization techniques across these technologies. Our codebase is a shared Turborepo called "Takeout". | |
• Prompt Context: | |
1. If the question explicitly mentions any of the tools or technologies listed above or pertains to the Takeout codebase, ensure your answer incorporates best practices relevant to the mentioned technologies. | |
2. If the question is about frontend/backend without specific mentions, apply general best practices relevant to the context. | |
3. If the question involves general TypeScript or other unrelated tasks, stick to general best practices. | |
4. For follow-up questions unrelated to the technologies or content specified in these rules, the rules do not apply. Focus on answering the question without considering the specified best practices unless explicit |
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :authentication_token, :string | |
add_index :users, :authentication_token, :unique => true | |
end | |
end |
#Credit to http://snippets.freerobby.com/post/491644841/remove-merged-branches-in-git for the script on which this is based | |
current_branch=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') | |
if [ "$current_branch" != "master" ]; then | |
echo "WARNING: You are on branch $current_branch, NOT master." | |
fi | |
echo "Fetching merged branches..." | |
git remote prune origin | |
remote_branches=$(git branch -r --merged | grep -v '/master$' | grep -v "/$current_branch$") | |
local_branches=$(git branch --merged | grep -v 'master$' | grep -v "$current_branch$") | |
if [ -z "$remote_branches" ] && [ -z "$local_branches" ]; then |
require 'spec_helper' | |
describe CommentsController do | |
let (:app_controller) { controller } | |
let (:motion) { mock_model(Motion) } | |
let (:comment) { mock_model(Comment, :default_motion => motion) } | |
context "deleting comment" do | |
before do | |
app_controller.stub(:authenticate_user!).and_return(true) |