Skip to content

Instantly share code, notes, and snippets.

@rauxalach
rauxalach / gist:2817249
Created May 28, 2012 04:38
Receive Claim on Registration > Claims tab
ActiveRecord::SubclassNotFound in Claim_receives#new
Showing /Users/huyle/Sites/aac/app/views/claim_receives/new.html.haml where line #8 raised:
The single-table inheritance mechanism failed to locate the subclass: 'Form530'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Form.inheritance_column to use another column for that information.
Extracted source (around line #8):
5: = simple_form_for [@registration, @claim, @claim_receive] do |f|
6:
7: = label_tag nil, 'Other received forms'
@rauxalach
rauxalach / gist:3234109
Created August 2, 2012 05:44
brew doctor error usr/bin before usr/local/bin
ah ok thanks for explaining this.
.bash_profile now reads:
[[ -s ~/.bashrc ]] && source ~/.bashrc
and .bashrc like this:
export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
echo $PATH gives me
/usr/local/bin:/usr/local/sbin:/Users/max/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/MacGPG2/bin
chown and friends are now working again.
@rauxalach
rauxalach / gist:3351648
Created August 14, 2012 18:50
Deploy Rails app on Heroku
heroku login
heroku create
git remote add heroku git@heroku.com:xx-xx-xx.git
git push heroku master
Migrate database
@rauxalach
rauxalach / gist:3411949
Created August 21, 2012 05:18
ckeditor config
CKEDITOR.editorConfig = (config) ->
config.removePlugins = 'elementspath'
config.resize_enabled = false
config.toolbarCanCollapse = false
config.extraPlugins += (if config.extraPlugins.length is 0 then '' else ',') + 'liquid-merge-fields'
config.toolbar_Custom = [
name: 'liquid'
items: [ 'Liquid Tags' ]
,
name: 'basicstyles'
@rauxalach
rauxalach / gist:3939860
Created October 23, 2012 16:23
RoR dev env
+ Ubuntu OS.
+ Git
+ rvm (Ruby Version Management) + gems + RoR 3.2.8
+ Postgres 9.x + PG Admin Tool.
+ Sublime Text 2 (Editor for coding).
+ Libs for dev: qt, imagemagick, ghostscript, wkhtmltopdf, redis.
+ Chrome (for debugging html + javascript)
+ Firefox
# encoding: UTF-8
class Heo
attr_accessor :tên
def initialize(tên)
@tên = tên
end
def xây_nhà
@rauxalach
rauxalach / gist:6161685
Last active December 20, 2015 16:29
Andrew
Claims wrong bulk received by Natasha (SRAS) user_id: 10811
[2473855, 2473859, 2473864, 2380661, 2285218, 2473392, 2381857, 2381861, 2381864, 2381871, 2381935, 2381933,
2474410, 2381937, 2474393, 2474397, 2474406, 2474418, 2381968, 2474432, 2381973, 2474436, 2474459, 2474472,
2436727, 2383494, 2474461, 2495457, 2495464, 2383452, 2383492, 2383491, 2383493, 2383497, 2383516, 2383527,
2383528, 2383554, 2383552, 2383578, 2383574, 2383585, 2383587, 2383592, 2383612, 2383613, 2383623, 2383630,
2383631, 2383637, 2383638, 2383633, 2383641, 2383640, 2383642, 2383643, 2383647, 2383650, 2383660, 2383664,
2383699, 2383708, 2383712, 2383730, 2383732, 2383748, 2370658, 2383761, 2383770, 2383775, 2383789, 2383788,
2383793,
2383794, 2347677, 2394467, 2394497, 2394665, 2394712, 2394723, 2394758, 2394764, 2395365, 2415790, 2499231,
* if is standard recommencement
if recommencement date >= 01/07/2012
+ if startdate <= 01/07/2012
recommencementdate + 3.months
+ if startdate > 01/07/2012
recommencementdate + 6.months
@rauxalach
rauxalach / gist:7364121
Created November 8, 2013 00:09
widgets
- signup_project.rb
scope :by_creator, -> (user) { where(created_by: user.id) }
- widgets/_signup_in_progres.html.haml
= widget 'signups_in_progress' do
%h4 #{icon('file-text')} Signup Projects In Progress (#{SignupProject.by_creator(current_user).count})
@rauxalach
rauxalach / gist:7523774
Created November 18, 2013 07:05
Letter CSV Import
class LetterImport < CSVImport
def import(row)
letter = Letter.where(template_name: row[:letter_name]).first_or_initialize
params = {
content: row[:letter_text]
}
if letter.new_record?
params[:created_by] = User.jobready.first