Skip to content

Instantly share code, notes, and snippets.

View rsgrafx's full-sized avatar
🏠
Working from home

Orion Engleton rsgrafx

🏠
Working from home
View GitHub Profile
@rsgrafx
rsgrafx / paperclip.ex
Last active September 18, 2017 15:28
Setting up Arc in a phoenix app that was ported from a rails app using paperclip.
# Ecto - Model
defmodule YourPhoenixApp.PaperclipAvatar do
use YourPhoenixApp.Web, :model
alias YourPhoenixApp.{Repo, PaperclipAvatar}
#
# There are places in my existing app where only the avatar image is required.
# So I created a module that sole purpose was to read that data.
#
schema "users" do
field :avatar_file_name, :string
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }