12
Root
5y

RSpec:
Undefined method 'agent_authorization=' for #<Periodic::Payment:0x000000C0FFEE>

Rails Console:
> Periodic::Payment.last.agent_authorization = "PPD"
=> "PPD"
> puts "Hmmm."
=> "Hmmm."

Comments
  • 2
    I'm no rails guy but isn't agent_auth a member of last and not of Payment?
  • 1
    @AlgoRythm I suppose that would look strange to non-Railsy devs. Enumerable#last returns the last element of e.g. an array, or in this case, the last record from the Periodic::Payment model. So it is calling the #agent_authorization= setter on an instance of the class.

    Still no clue why it isn't working in the test env 😕
  • 3
    @Root Maybe if you removed the C0FFEE from your machine it would run better.
  • 0
    What the fuck is that even supposed to mean.

    This is worse error logging than in c(forgot the compiler name)
  • 1
    @Ranchu quite ez it says that this instance of this object does not have a method with that name.
  • 0
    Is spring preloading fucking shit up again?
  • 1
    @fuckwit you're right, but what the hell does the 'for <cryptic stuff>' mean?
  • 2
    @Ranchu that's the objects ID ruby assigns to an object. Rspec does some fancy stuff with that.
  • 2
    @Ranchu it's basically this format <Module::Class:InternalInstanceID>
  • 0
    @fuckwit Interesting, thanks.
  • 0
    It wasn't the code at all. I just needed to clone the dev db into the test db.

    Ugh.
Add Comment