Skip to content

Instantly share code, notes, and snippets.

View landlessness's full-sized avatar

Brian S. Mulloy landlessness

View GitHub Profile
# i started with the following, which i thought would work with no problem:
AddOn.joins(:pricing_plans).joins(:subscriptions)
# returned this error:
# ActiveRecord::ConfigurationError:
# Association named 'subscriptions' was not found; perhaps you misspelled it?
# trying to get at it from the other direction:
PricingPlan.joins(:subscriptions).joins(:person)
# of course this didn't work either
# ActiveRecord::ConfigurationError: Association named 'person' was not found; perhaps you misspelled it?
class Person
# ...
def add_ons
AddOn.joins(:pricing_plans => {:subscriptions => :person}).where(:subscriptions => {:person_id => self})
end
# ...
end
person = Person.first
person.add_ons
person = Person.first
add_on = AddOn.first
person.add_ons.exists?(add_on)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8 />
<title>Font Size Experiments</title>
<style type="text/css">
span {margin:0;padding:0;}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script>
require 'spec'
require 'rspec'
<table id="tablepress-2" class="tablepress tablepress-id-2">
<caption style="caption-side:bottom;text-align:left;border:none;background:none;margin:0;padding:0;"><a href="http://detroit-ashore-me.ashoremedia.staging.wpengine.com/wp-admin/admin.php?page=tablepress&action=edit&table_id=2" >Edit</a></caption>
<thead>
<tr class="row-1 odd">
<th colspan="9" class="column-1"><div>Current Entries for the Cove Island Course:</div></th>
</tr>
</thead>
<tbody>
<tr class="row-2 even">
<td colspan="9" class="column-1">Division I - Cove Island</td>
@landlessness
landlessness / gist:9f2239aaefc6ac3a04ab
Created October 22, 2014 15:03
npm install serialport failure on BeagleBone Black
root@beaglebone:/var/lib/cloud9/zetta-fona-bonescript-driver# npm install
npm http GET https://registry.npmjs.org/serialport
npm http 304 https://registry.npmjs.org/serialport
npm http GET https://registry.npmjs.org/bindings/1.2.1
npm http GET https://registry.npmjs.org/async/0.9.0
npm http GET https://registry.npmjs.org/sf/0.1.7
npm http 304 https://registry.npmjs.org/async/0.9.0
npm http 304 https://registry.npmjs.org/bindings/1.2.1
npm http 304 https://registry.npmjs.org/sf/0.1.7
npm http GET https://registry.npmjs.org/minimist
2015-08-05 12:23:48.176 ZettaKit[2904:445915] -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb000000000000473
2015-08-05 12:23:48.183 ZettaKit[2904:445915] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb000000000000473'
*** First throw call stack:
(
0 CoreFoundation 0x0000000107f4cc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109db0bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107f540ad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107eaa13c ___forwarding___ + 988
4 CoreFoundation 0x0000000107ea9cd8 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001089bdc7f -[UITableViewLabel setText:] + 81