Skip to content

Instantly share code, notes, and snippets.

@jamiecook
Created May 14, 2015 09:17
Show Gist options
  • Save jamiecook/f831add0dbe5d5a54982 to your computer and use it in GitHub Desktop.
Save jamiecook/f831add0dbe5d5a54982 to your computer and use it in GitHub Desktop.
changes = {# Authorised Kahuna Data Kahuna_valid Archived
Selection.status_pending => [SiteAuthorisation::ALTERED, true, false, false],
Selection.status_null_no_data_ => [SiteAuthorisation::AUTHORISED, false, false, false],
Selection.status_reject_new_ => [SiteAuthorisation::REJECTED, false, false, false],
Selection.status_reject_change_ => [SiteAuthorisation::REJECTED, true, false, false],
Selection.status_current => [SiteAuthorisation::AUTHORISED, true, true, false],
Selection.status_archived_has_data_ => [SiteAuthorisation::AUTHORISED, true, true, true],
Selection.status_archived_no_data_ => [SiteAuthorisation::ALTERED, false, false, true],
Selection.status_new => [SiteAuthorisation::ALTERED, false, false, false],
Selection.status_altered => [SiteAuthorisation::ALTERED, false, false, false],
}
counts = changes.inject({}){ |h,(old_status,states)|
h[old_status] = Site.where(:status_id => old_status.id).count
}
puts counts
@imnithin
Copy link

I got, NoMethodError: undefined method `[]=' for 11981:Fixnum

@imnithin
Copy link

Is it giving in all the sites from the status_id using selections..So we could still look to modify the rake task?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment