Skip to content

Instantly share code, notes, and snippets.

@kofno
kofno / confirmed ugly and prabably smelly go
Created January 8, 2009 21:53
crazy disease status rules example
buggy
[ ] confirmed
[ ] probable
smelly
[ ] confirmed
[X] probable
ugly
[X] confirmed
@kofno
kofno / betternestedset.diff
Created February 24, 2009 23:50
two patches, one just for betternestedset
--- a/webapp/vendor/plugins/betternestedset/lib/better_nested_set.rb
+++ b/webapp/vendor/plugins/betternestedset/lib/better_nested_set.rb
@@ -1093,17 +1093,19 @@ module SymetrieCom
private
# override the sql preparation method to exclude the lft/rgt columns
# under the same conditions that the primary key column is excluded
- def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true) #:nodoc:
+ def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys) #:nodoc:
left_and_right_column = [acts_as_nested_set_options[:left_column], acts_as_nested_set_options[:right_column]]
- quoted = attributes.inject({}) do |quoted, (name, value)|
ActionView::TemplateError (You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.new_record?) on line #32 of app/views/events/_contact_show_tab.html.haml:
29:
30: %fieldset.form
31: %legend Contacts | Elevated to morbidity Events
32: - if @event.morbidity_child_events.first.new_record?
33: %h3 None
34: - else
35: = render :partial => 'events/contact_show', :locals => { :contacts => @event.morbidity_child_events }
FormElementCache initialize only handles FormElements (ActionView::TemplateError)
On line #19 of app/views/events/people/_name_show.html.haml
16: %fieldset.form
17: %legend Name
18: -f.fields_for(:person, :builder => ExtendedFormBuilder) do |person_form|
19: -core_element_show :last_name, person_form, :horiz do
20: =person_form.label(:last_name)
21: =person.last_name
22: -core_element_show :first_name, person_form, :horiz do
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.gsub (NoMethodError)
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:52:in `replace_nbsp_ref'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:30:in `matches_text?'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:18:in `matching_links'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:17:in `select'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:17:in `matching_links'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:13:in `link_element'
/home/ryan/opt/jruby-1.1.6/lib/ruby/gems/1.8/gems/webrat-0.4.2/lib/webrat/core/locators/link_locator.rb:
wrong number of arguments (2 for 1) (ArgumentError)
./features/step_definitions/contact_to_morbidity_steps.rb:36:in `have_selector'
./features/step_definitions/contact_to_morbidity_steps.rb:36:in `Then /^the morbidity event should have disease forms for MA1 and CA1$/'
features/contact_to_morbidity.feature:31:in `Then the morbidity event should have disease forms for MA1 and CA1'
Test::Unit::AssertionFailedError in 'FormsController route generation should map { :controller => 'forms', :action => 'rollback', :id => 1} to /forms/rollback/1'
The recognized options <{"action"=>"rollback", "id"=>"1", "controller"=>"forms"}> did not match <{"action"=>"rollback", "id"=>1, "controller"=>"forms"}>, difference: <{"id"=>1}>
AssociatedJurisdiction < Participation
Clinician < Participation
DiagnosticFacility < Participation
HospitalizationFacility < Participation
InterestedParty < Participation
InterestedPlace < Participation
Jurisdiction < Participation
Lab < Participation
Reporter < Participation
ReportingAgency < Participation
@kofno
kofno / gist:95957
Created April 15, 2009 18:53
'cucumber features/standard -n -p standard ' backtrace
/home/ryan/projects/trisano/trisano/webapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Spec::Runner (NameError)
from /home/ryan/projects/trisano/trisano/webapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
from /home/ryan/projects/trisano/trisano/webapp/vendor/plugins/webrat/lib/webrat/rspec-rails.rb:8
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
from /usr/local/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in `require'
from /home/ryan/projects/trisano/trisano/webapp/vendor/rails/activesupport/lib/active_support/dependencies.rb:158:in `require'
from ./features/support/env.rb:28
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
... 6 levels...
Installing the data warehouse
CREATE DATABASE trisano_dw ENCODING='UTF8'
CREATE DATABASE
ALTER SCHEMA
CREATE ROLE
NOTICE: schema "trisano" does not exist
ALTER ROLE
CREATE SCHEMA
ALTER SCHEMA
psql:../bi/scripts/warehouse_init_to_run.sql:20: ERROR: language "plpgsql" already exists