Skip to content

Instantly share code, notes, and snippets.

View akinsgre's full-sized avatar

Greg Akins akinsgre

View GitHub Profile
class Contact < ActiveRecord::Base
has_many :groups, :through => :group_contacts
has_many :group_contacts
has_many :messages
belongs_to :user
validates_presence_of :entry
<div class="row-fluid">
<div class="col1 span4">Test 1</div>
<div class="col1 span4">Test 2</div>
<div class="col1 span4">Test 3</div>
</div>
class Employee < User
set_primary_key :employee_id
has_one :user, :foreign_key => :employee_id
has_many :goals, :conditions => ["goals.year = ?", Phase.year]
has_many :approved_goals, :class_name => "Goal" , :conditions => ["state_id in (?) and goals.year = ?", State.approved_states, Phase.year], :order => :title
has_many :employee_pending_goals, :class_name => "Goal" , :conditions => ["state_id in (?) and goals.year = ?", State.employee_pending_states, Phase.year], :order => :title
has_many :supervisor_pending_goals, :class_name => "Goal" , :conditions => ["state_id in (?) and goals.year =?", State.supervisor_pending_states, Phase.year], :order => :title
has_many :abandoned_goals, :class_name => "DeletedGoal", :conditions => ["deleted_goals.year = ?", Phase.year], :conditions => ["updated_at >= ?", Phase.find_by_description("Phase II").date], :order => :title
TypeError: can't convert Symbol into Integer
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/nested_attributes.rb:363:in `[]'
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/nested_attributes.rb:363:in `block in assign_nested_attributes_for_collection_association'
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/nested_attributes.rb:363:in `map'
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/nested_attributes.rb:363:in `assign_nested_attributes_for_collection_association'
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/nested_attributes.rb:254:in `party_attributes='
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/activerecord-3.0.20/lib/active_record/base.rb:1569:in `block in attributes='
from /Users/gakins/.rvm/gems/ruby-1.9.2-p320@landmark/gems/acti
<Virtualhost *:80>
ServerName test.gaiconsultants.com
ServerAlias dev-test.gaiconsultants.com
ServerAlias test-test.gaiconsultants.com
DocumentRoot /var/www/test/public/
#UseCanonicalName Off
RailsEnv production
<Directory /var/www/test/public>
# Options ExecCGI FollowSymLinks
@akinsgre
akinsgre / dump
Created January 21, 2014 18:50
Dump of error message after Wahjam crashes
Process: wahjam [25123]
Path: /Users/USER/*/wahjam.app/Contents/MacOS/wahjam
Identifier: org.wahjam.wahjam
Version: 0.9 (???)
Code Type: X86-64 (Native)
Parent Process: launchd [355]
User ID: 501
Date/Time: 2014-01-21 13:48:39.137 -0500
OS Version: Mac OS X 10.8.5 (12F45)
[gakins@Somnambulist ~]$ cd ~/Projects/wahjam/
[gakins@Somnambulist wahjam]$ qmake -spec macx-g++
[gakins@Somnambulist wahjam]$ make
cd common/ && make -f Makefile
g++ -c -pipe -Wno-write-strings -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -fPIC -Wall -W -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Cellar/qt/4.8.3/mkspecs/macx-g++ -I. -I/usr/local/Cellar/qt/4.8.3/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.3/lib/QtCore.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.3/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.3/lib/QtNetwork.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.3/include -I. -F/usr/local/Cellar/qt/4.8.3/lib -o njclient.o njclient.cpp
In file included from njclient.cpp:33:
njclient.h:55:22: error: portmidi.h: No such file or directory
In file included from njclient.cpp:33:
njclient.h:163: error: ‘PmEvent’ was not declared in this scope
njclient.h:163: error: template argument 1 is invalid
@akinsgre
akinsgre / gist:7810416
Created December 5, 2013 18:14
Heroku deploy
Counting objects: 1, done.
Writing objects: 100% (1/1), 207 bytes, done.
Total 1 (delta 0), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Using rake (10.0.4)
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
/tmp/build_1ab9c74d-105c-4275-a85a-9cbbe1c303d9/vendor/bundle/ruby/2.0.0/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: already initialized constant Net::SMTPSession
/tmp/build_1ab9c74d-105c-4275-a85a-9cbbe1c303d9/vendor/bundle/ruby/2.0.0/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: previous definition of SMTPSession was here
/tmp/build_1ab9c74d-105c-4275-a85a-9cbbe1c303d9/vendor/bundle/ruby/2.0.0/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: already initialized constant Net::POP
/tmp/build_1ab9c74d-105c-4275-a85a-9cbbe1c303d9/vendor/bundle/ruby/2.0.0/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: previous definition of POP was here
/tmp/build_1ab9c74d-105c-4275-a85a-9cbbe1c303d9/vendor/bundle/ruby/2.0.0/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: already initialized constant Net::POPSession
/tmp/build_1ab9c74d-
db_user.emp_id = EmployeeID.find_by_Username(login).Employee #Returns 9999 in script/console... but 1806 in script/server