Giter VIP home page Giter VIP logo

Comments (6)

noctivityinc avatar noctivityinc commented on June 20, 2024 1

Here is the full chain:

2.6.1 :002 > u = User.find('XXXX-XXXX')
ETHON: performed EASY effective_url=http://domain.com/v1/admin/users/XXXX-XXXX response_code=200 return_code=ok total_time=2.526228
D, [2019-02-18T08:43:05.160459 #67471] DEBUG -- : [httplog] Sending: GET
D, [2019-02-18T08:43:05.160681 #67471] DEBUG -- : [httplog] Data:
D, [2019-02-18T08:43:05.160856 #67471] DEBUG -- : [httplog] Status: 200
D, [2019-02-18T08:43:05.161028 #67471] DEBUG -- : [httplog] Benchmark: 2.526608 seconds
D, [2019-02-18T08:43:05.161482 #67471] DEBUG -- : [httplog] Response: (not showing binary data)
 => #<User(users/XXXX-XXXX) active=true full_name="Marcelo Drakeford " first_name="Marcelo" email="[email protected]" stripe_id="cus_Ch7PG7epplUbph" created_at="2018-04-17T02:03:51.260Z" updated_at="2018-10-20T22:55:55.303Z" utc_offset=-5 alpha_firmware_access=false beta_firmware_access=false expert_mode=false enable_remote_logging=false devices_count=1 user_device_offers_count=1 activities_count=0 stripe=nil payment={"exists"=>false, "current"=>false, "needed"=>true, "expired"=>true} id="1ecec758-5fb7-456c-b10f-70b2512821cc">

2.6.1 :003 > u.user_device_offers.all
 => #<Her::Model::Associations::HasManyAssociation:0x00007ff42ee7d1d0 @parent=#<User(users/1ecec758-5fb7-456c-b10f-70b2512821cc) active=true full_name="Marcelo Drakeford " first_name="Marcelo" email="[email protected]" stripe_id="cus_Ch7PG7epplUbph" created_at="2018-04-17T02:03:51.260Z" updated_at="2018-10-20T22:55:55.303Z" utc_offset=-5 alpha_firmware_access=false beta_firmware_access=false expert_mode=false enable_remote_logging=false devices_count=1 user_device_offers_count=1 activities_count=0 stripe=nil payment={"exists"=>false, "current"=>false, "needed"=>true, "expired"=>true} id="XXXX-XXXX">, @opts={:class_name=>"UserDeviceOffer", :name=>:user_device_offers, :data_key=>:user_device_offers, :default=>[], :path=>"/user_device_offers", :inverse_of=>nil}, @params={}, @klass=UserDeviceOffer, @name=:user_device_offers>

2.6.1 :004 > u.user_device_offers.first
ETHON: performed EASY effective_url=http://domain.com/v1/admin/users/XXXX-XXXX/user_device_offers response_code=200 return_code=ok total_time=0.011298
D, [2019-02-18T08:43:12.593182 #67471] DEBUG -- : [httplog] Sending: GET
D, [2019-02-18T08:43:12.593368 #67471] DEBUG -- : [httplog] Data:
D, [2019-02-18T08:43:12.593503 #67471] DEBUG -- : [httplog] Status: 200
D, [2019-02-18T08:43:12.593624 #67471] DEBUG -- : [httplog] Benchmark: 0.011605 seconds
D, [2019-02-18T08:43:12.593912 #67471] DEBUG -- : [httplog] Response: (not showing binary data)
Traceback (most recent call last):
        1: from (irb):4
NoMethodError (undefined method `map' for nil:NilClass)

from her.

noctivityinc avatar noctivityinc commented on June 20, 2024 1

@zacharywelch figured it out. Since the model is UserDeviceOffers the serialized json root is userdeviceoffersso I needed to add:

parse_root_in_json :userdeviceoffers

from her.

zacharywelch avatar zacharywelch commented on June 20, 2024

Do you have a sample response and the call which is producing the error?

from her.

noctivityinc avatar noctivityinc commented on June 20, 2024

@zacharywelch was that what you were looking for? Here's even more logs:

oMethodError: undefined method `map' for nil:NilClass
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/attributes.rb", line 182, in instantiate_collection
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/attributes.rb", line 193, in new_collection
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/http.rb", line 72, in block in get
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/http.rb", line 59, in request
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/http.rb", line 81, in get_raw
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/http.rb", line 70, in get
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/associations/association.rb", line 52, in fetch
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/associations/has_many_association.rb", line 86, in fetch
  File "/home/vcap/deps/0/vendor_bundle/ruby/2.6.0/gems/her-1.1.0/lib/her/model/associations/association_proxy.rb", line 11, in tap

from her.

zacharywelch avatar zacharywelch commented on June 20, 2024

That should be enough @noctivityinc. Not sure why a separate request is made to pick up the first device offer since they should be cached after .all. Tied up at the moment but I'll try and reproduce later.

from her.

noctivityinc avatar noctivityinc commented on June 20, 2024

from her.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.