Sha256: fcde4748698565a8c1fe1c65449b0362bea82159bc65c4486566e2accb0f56b3

Contents?: true

Size: 190 Bytes

Versions: 7

Compression:

Stored size: 190 Bytes

Contents

module HashExtension
  KEYS_TO_AVOID = ["_destroy", "id"]
  def copy_without_destroy
    a = {}
    self.each {|key,val| a[key]=val unless KEYS_TO_AVOID.include?(key.to_s)}
    a
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
anaf_habtm-0.0.7 lib/hash.rb
anaf_habtm-0.0.6 lib/hash.rb
anaf_habtm-0.0.5 lib/hash.rb
anaf_habtm-0.0.4 lib/hash.rb
anaf_habtm-0.0.3 lib/hash.rb
anaf_habtm-0.0.2 lib/hash.rb
anaf_habtm-0.0.1 lib/hash.rb