Skip to content

Instantly share code, notes, and snippets.

@technoweenie
Created July 7, 2009 04:12
Show Gist options
  • Save technoweenie/141882 to your computer and use it in GitHub Desktop.
Save technoweenie/141882 to your computer and use it in GitHub Desktop.
# exhibit a
{:conditions => case f.to_s
when 'active' then {:state => @@states[2]}
when 'disabled' then {:state => @@states[0..1]}
when 'all' then {}
else {:state => @@states[3]}
end}
# exhibit b
case f.to_s
when 'active' then {:conditions => {:state => @@states[2]}}
when 'disabled' then {:conditions => {:state => @@states[0..1]}}
when 'all' then {}
else {:conditions => {:state => @@states[3]}}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment