Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Created March 7, 2011 21:53
Show Gist options
  • Select an option

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

Select an option

Save chewmanfoo/859343 to your computer and use it in GitHub Desktop.
def self.on_time
select {|s| s.generally_available_on.blank? ? (Date.today <= s.qa_original_completed_on) : (s.generally_available_on <= s.qa_original_completed_on)}
end
returns error:
sw = SoftwareRelease.by_month(date).on_time
ArgumentError: wrong number of arguments (0 for 1)
but used in the console, it works:
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)}
=> [#<SoftwareRelease id: ...>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment