Skip to content

Instantly share code, notes, and snippets.

View murraycs's full-sized avatar

Murray Sampson murraycs

View GitHub Profile
@murraycs
murraycs / roles
Created September 29, 2011 21:58
roles.yml
admin:
id: 1
name: admin
moderator:
id: 2
name: moderator
member:
id: 3
name: member
@murraycs
murraycs / gist:1252075
Created September 29, 2011 22:06
error
ActiveRecord::RecordNotSaved: ActiveRecord::RecordNotSaved
/app/.bundle/gems/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2555:in `save_without_validation!'
/app/.bundle/gems/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1088:in `save_without_dirty!'
/app/.bundle/gems/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/app/.bundle/gems/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:200:in `save!'
@murraycs
murraycs / gist:1252088
Created September 29, 2011 22:13
errors
#<ActiveRecord::Errors:0x7f5691f091c0 @errors={"name"=>[#<ActiveRecord::Error:0x7f5691f05070 @attribute="name", @message="changes to acts_as_enumeration model instances are not permitted", @base=#<Role id: nil, name: "admin">, @options={}, @type="changes to acts_as_enumeration model instances are not permitted">]}, @base=#<Role id: nil, name: "admin">>
@murraycs
murraycs / gist:1252090
Created September 29, 2011 22:15
Rake tasks
rake clean # Remove...
rake clobber # Remove...
rake community_engine:db:fixtures:load # Load c...
rake community_engine:db:migrate:upgrade_desert_plugin_migrations # For CE...
rake community_engine:generate_deploy_script # Genera...
rake community_engine:make_admin # Assign...
rake community_engine:mirror_assets # Mirror...
rake community_engine:test # Run te...
rake community_engine:test:clobber_rcov # Remove...
rake community_engine:test:rcov # genera...
@murraycs
murraycs / gist:1252096
Created September 29, 2011 22:17
Rake error
PGError: ERROR: invalid input syntax for type timestamp: "nil"
: INSERT INTO "messages" ("created_at", "body", "updated_at", "subject", "recipient_id", "id", "read_at", "sender_id", "sender_deleted", "recipient_deleted") VALUES (E'2011-09-27 22:17:13', E'Test body', E'2011-09-27 22:17:13', E'Test message', 3, 2, E'nil', 6, 'f', 't')
@murraycs
murraycs / gist:1252151
Created September 29, 2011 22:43
logs
Processing UsersController#create (for 127.0.0.1 at 2011-09-27 14:20:32) [POST]
Parameters: {"commit"=>"Sign Up!", "authenticity_token"=>"mt29UTvAvWTbPF8pIFjyHE0HvxcNxuGi8F4GWVq1w6k=", "inviter_code"=>"", "inviter_id"=>"", "user"=>{"birthday(1i)"=>"1986", "birthday(2i)"=>"9", "password_confirmation"=>"12345", "birthday(3i)"=>"27", "password"=>"12345", "login"=>"winnie", "email"=>"winnielyo@msn.com"}}
[I18n] loading locale: en from config
[I18n] Locale set to en
Role Load (0.3ms) SELECT * FROM "roles" 
User Load (0.2ms) SELECT "users".id FROM "users" WHERE (LOWER("users"."email") = 'winnielyo@msn.com') LIMIT 1
User Load (0.1ms) SELECT "users".id FROM "users" WHERE (LOWER("users"."login") = 'winnie') LIMIT 1
User Load (0.3ms) SELECT "users".id FROM "users" WHERE ("users"."persistence_token" = '2ef0c705f3a2f0c90edd765fcb92527e4020cebce15bf7dbae9bf031731716357c2a8ad326775929b1256f0c876fde8a0d989e15864de795748949f
@murraycs
murraycs / gist:1252280
Created September 29, 2011 23:56
Name error
ActionView::TemplateError (undefined method `name' for nil:NilClass) on line #24 of vendor/plugins/community_engine/app/views/shared/_location_chooser.html.haml:
2011-09-29T23:48:46+00:00 app[web.1]: 21: :with => "'state_id=' + $('state_id').value + '&country_id=' + $('country_id').value", |
2011-09-29T23:48:46+00:00 app[web.1]: 22: :loading => "$$('span#location_chooser img')[0].show();", |
2011-09-29T23:48:46+00:00 app[web.1]: 23: 500 => "alert('"+:sorry_there_was_an_error.l+"'); return false", |
2011-09-29T23:48:46+00:00 app[web.1]: 24: :update => "location_chooser"}) |
2011-09-29T23:48:46+00:00 app[web.1]: 25:
2011-09-29T23:48:46+00:00 app[web.1]: 26: %span
2011-09-29T23:48:46+00:00 app[web.1]: 27:
2011-09-29T23:48:46+00:00 app[web.1]:
2011-09-29T23:48:46+00:00 app[web.1]: vendor/plugins/community_engine/app/models/country.rb:14:in `find_countries_with_metros'
@murraycs
murraycs / CE_NoMethodError
Created October 11, 2011 18:57
NoMethodError
NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.+):
vendor/plugins/community_engine_premium_members/app/controllers/base_controller.rb:15:in `add_admin_links'
haml (2.2.2) lib/sass/plugin/rails.rb:19:in `process'
/Users/kelaar/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/kelaar/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/kelaar/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/kelaar/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/kelaar/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
@murraycs
murraycs / base_controller.rb
Created October 11, 2011 19:11
Line 15 throws the error
class BaseController < ApplicationController
require 'simplepay/authentication'
require 'simplepay/rails'
before_filter :add_admin_links
before_filter :add_subscription_return_url
private
def add_admin_links
links = [
@murraycs
murraycs / simplepay.rb
Created October 11, 2011 19:32
Simplepay.rb
Simplepay.aws_access_key_id = 'ACCESS_KEY_ID'
Simplepay.aws_secret_access_key = 'SECRET_ACCESS_KEY'
if RAILS_ENV.eql?('development')
Simplepay.account_id = 'ACCOUNT_ID'
Simplepay.use_sandbox = true
else
Simplepay.account_id = 'ACCOUNT_ID'
Simplepay.use_sandbox = false
end