Sha256: 7b42477d8bcc1db7b7877ee3f84be818a3af4747e60c4f07cbb46242ddb34ed1
Contents?: true
Size: 718 Bytes
Versions: 4
Compression:
Stored size: 718 Bytes
Contents
class Sequel::Fixture # === Description # Simplifies the hash in order to insert it into the database # (Note: I'm well aware that this functionality belongs in a dependency) # def simplify(the_hash) the_returned_hash = {} the_hash.each do |key, value| if value.is_a? Hash unless value.has_key?("processed") || value.has_key?(:processed) raise MissingProcessedValueError.new "The processed value to insert into the db is missing from the field '#{key}', aborting", key end the_returned_hash[key] = value["processed"] || value[:processed] else the_returned_hash[key] = value end end return the_returned_hash end end
Version data entries
4 entries across 4 versions & 2 rubygems