Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Created March 7, 2011 20:40
Show Gist options
  • Select an option

  • Save chewmanfoo/859169 to your computer and use it in GitHub Desktop.

Select an option

Save chewmanfoo/859169 to your computer and use it in GitHub Desktop.
Sadness in the console:
date = Date.parse("2011-03-01")
=> Tue, 01 Mar 2011
>> sw = SoftwareRelease.by_month(date)
=> [#<SoftwareRelease id: ...>]
>> sw = SoftwareRelease.by_month(date).select {|s| s.generally_available_on.blank?}
=> [#<SoftwareRelease id: ...>]
>> sw = SoftwareRelease.by_month(date).select {|s| s.generally_available_on.blank? && Date.today <= s.qa_original_completed_on }
=> [#<SoftwareRelease id: ...>]
>> sw = SoftwareRelease.by_month(date).select {|s| s.generally_available_on.blank? && Date.today <= s.qa_original_completed_on || s.world_edit.blank?}
=> [#<SoftwareRelease id: ...>]
>> sw = SoftwareRelease.by_month(date).select {|s| s.generally_available_on.blank? && Date.today <= s.qa_original_completed_on || s.generally_available_on <= s.qa_original_completed_on}
NoMethodError: undefined method `<=' for nil:NilClass
[...]
>> sw = SoftwareRelease.by_month(date).select {|s| (s.generally_available_on.blank? && Date.today <= s.qa_original_completed_on) || s.generally_available_on <= s.qa_original_completed_on}
NoMethodError: undefined method `<=' for nil:NilClass
[...]
>> sw = SoftwareRelease.by_month(date).select {|s| (s.generally_available_on.blank? && Date.today <= s.qa_original_completed_on) || (s.generally_available_on <= s.qa_original_completed_on)}
NoMethodError: undefined method `<=' for nil:NilClass
[...]
>> sw = SoftwareRelease.by_month(date).select {|s| (((s.generally_available_on.blank? && (Date.today <= s.qa_original_completed_on)) || (s.generally_available_on <= s.qa_original_completed_on)))}
NoMethodError: undefined method `<=' for nil:NilClass
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment