app/helpers/blacklight/hierarchy_helper.rb
# FIXME: remove baked in underscore separator in field name
remove baked in underscore separator in field name
remove baked in underscore separator in field name
def rotate_facet_params(prefix, from, to, p = params.dup)
    return p if from == to
    from_field = "#{prefix}_#{from}"
    to_field = "#{prefix}_#{to}"
    p[:f] = (p[:f] || {}).dup 
    p[:f][from_field] = (p[:f][from_field] || []).dup
    p[:f][to_field] = (p[:f][to_field] || []).dup
    p[:f][from_field].reject! { |v| p[:f][to_field] << rotate_facet_value(v, from, to); true }
    p[:f].delete(from_field)
    p[:f][to_field].compact!
    p[:f].delete(to_field) if p[:f][to_field].empty?
    p
  end
def rotate_facet_params ( prefix , from , to , p = params . dup ) return p if from == to from_field = "#{prefix}_#{from}" to_field = "#{prefix}_#{to}" p [ :f ] = ( p [ :f ] || { } ) . dup p [ :f ] [ from_field ] = ( p [ :f ] [ from_field ] || [ ] ) . dup p [ :f ] [ to_field ] = ( p [ :f ] [ to_field ] || [ ] ) . dup p [ :f ] [ from_field ] . reject! { | v | p [ :f ] [ to_field ] << rotate_facet_value ( v , from , to ) ; true } p [ :f ] . delete ( from_field ) p [ :f ] [ to_field ] . compact! p [ :f ] . delete ( to_field ) if p [ :f ] [ to_field ] . empty? p end
FIXME: remove baked in underscore separator in field name
FIXME : remove baked in underscore separator in field name
# the command above is not deep in rails3, !@#$!@#$
prefix
<not_specific>
from
<not_specific>
to
<not_specific>
p
<not_specific>
params
<not_specific>
dup
<not_specific>