Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Michael Herold
    Haha, glad to help
    James DeHart

    So i found this out. (RTFM)
    var = {:status=>0, :value=>{:build=>{:version=>"1.4.8", :revision=>"c8179bd8352d3c62d98fa58b324491230df9342a"}, :build2=>{:version=>"1.4.9", :revision=>"c8179bd8352d3c6"}}}


    Daniel (dB.) Doubrovkine
    Jesse Trimble
    Hi! Using Hashie::Extensions::Coercion, I've got a bit of data I'm trying to coerce into Hash[String => Hash[String => BigDecimal]], but the BigDecimal part of that can also be nil - is there a way to handle that scenario that I'm missing (other than creating new classes to coerce to)? Getting Hashie::CoercionError: Cannot coerce property :property_name from Hash to {String=>{String=>BigDecimal}}: no implicit conversion of nil into String when I hit a nil value in that BigDecimal field
    Jesse Trimble
    I suppose I could make a thin wrapper around BigDecimal that handles nil values in a better way for my use case
    Yep, that works. Sorry for posting a question I answered myself :\
    Gus P
    W, [2018-02-07T09:46:38.025179 #30973] WARN -- : You are setting a key that conflicts with a built-in method Hashie::Mash#count defined in Enumerable. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.
    how can i remove this log error?
    TL;DR: set logger to something empty, or subclass Mash and disable warnings in subclass.
    Gus P
    @zverok where would I put that in my rails app?
    Victor Shepelev
    Wherever you put this kind of stuff, initializers probably.
    Gus P
    config/initializers/hashie.rb:1:in `<top (required)>': uninitialized constant Hashie (NameError)
    Victor Shepelev
    probably it is still not required when initializer is called. try requireing it explicitly (or google how people typically solve this, I've never did that exact thing, just theorizing)
    Gus P
    hashie (3.5.7) is in my gemfile.lock
        instagram (1.1.6)
          faraday (>= 0.7, < 0.10)
          faraday_middleware (>= 0.8, < 0.10)
          hashie (>= 0.4.0)
          multi_json (~> 1.0, >= 1.0.3)
    Martin Streicher
    @staycreativedesign Are you able to rename the count field?
    The message comes from using a key in the mash that conflicts with a built-in Mash method
    I had one called cycle that I changed to avoid issues.
    Peter Fitzgibbons
    Hello! (Is this thing still on?!) IF anyone can hear me :) I'm wondering if there is a more-elegant way to use lambda coercions? Like wrap them in a class or a constant or something? Something like a coercion to/from Date is "simple" yet verbose due to the lambda and a necessary predicate/gate test on value.is_a?(Date).
    Thoughts anyone?
    Bobby McDonald
    Hello, discussion will be moving to https://gitter.im/hashie/hashie