app/helpers/cornell_catalog_helper.rb
# Get rid of unnecessary avail statuses
# condensed is an array of hashes
Get rid of unnecessary avail statuses
condensed is an array of hashes
Get rid of unnecessary avail statuses condensed is an array of hashes
def trim_avail(condensed)
	  condensed.each do |loc|
	      if loc["copies"][0]["items"].keys.count  > 1 &&  loc["copies"][0]["items"].has_key?('Available')
		loc["copies"][0]["items"].delete_if {|key, value| key == "Available" }
	      end
	  end
	  condensed
	  end
def trim_avail ( condensed ) condensed . each do | loc | if loc [ "copies" ] [ 0 ] [ "items" ] . keys . count > 1 && loc [ "copies" ] [ 0 ] [ "items" ] . has_key? ( 'Available' ) loc [ "copies" ] [ 0 ] [ "items" ] . delete_if { | key , value | key == "Available" } end end condensed end
Get rid of unnecessary avail statuses
condensed is an array of hashes
Get rid of unnecessary avail statuses condensed is an array of hashes
##Rails.logger.debug "\nes287_debug line(#{__LINE__}) copies  =   " + loc["copies"].count.inspect ##Rails.logger.debug "\nes287_debug line(#{__LINE__}) copies  =   " + loc["copies"].inspect ##Rails.logger.debug "\nes287_debug line(#{__LINE__}) copies [0] items keys count =   " + loc["copies"][0]["items"].keys.count.inspect ##Rails.logger.debug "\nes287_debug line(#{__LINE__}) copies [0] items =   " + loc["copies"][0]["items"].inspect ##Rails.logger.debug "\nes287_debug line(#{__LINE__}) available exists with more than one status,so we will remove it as unnecessary."
condensed
<not_specific>