Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Jason Frey
    @Fryguy
    that worked fine locally :/
    Brandon Dunne
    @bdunne
    the bot is fine, it's codeclimate
    Jason Frey
    @Fryguy
    but codeclimate just runs rubocop...not sure why it wouldn't work?
    Brandon Dunne
    @bdunne
    it doesn't have styles/base.yml downloaded
    Jason Frey
    @Fryguy
    yeah, but curious why not, considering that's inside the gem
    it's almost like the gem isn't installed?
    Brandon Dunne
    @bdunne
    I don't think codeclimate installs any of our gems
    Jason Frey
    @Fryguy
    hmmm I'll take a look
    I think we can just add more fetch lines for the other files
    still needs a blaster outer, but also still doable
    Daniel Berger
    @djberg96
    (nothing serious, when you have some spare time, please take a look)
    is that supposed to be db_klass?
    unless that's an accessor I'm not seeing, i don't see how this method works
    Jason Frey
    @Fryguy
    it's a method
    Daniel Berger
    @djberg96
    aha, thanks
    alright, let me ask another probably silly question
    Jason Frey
    @Fryguy
    it's part of the report itself
    it's a column
    Daniel Berger
    @djberg96
    thanks, guess it's assumed the mixing in class has that method
    Jason Frey
    @Fryguy
    yes
    Daniel Berger
    @djberg96
    ok, this is curious
    i have an ems (azure int this case, but whatever), and it has a guid
    the uuidmixin has a validation on it for :presence => true
    which the ExtManagementClass mixes in
    and yet
    rb(main):009:0> ems.guid = nil
    => nil
    irb(main):010:0> ems.save
       (0.2ms)  BEGIN
       (0.4ms)  ROLLBACK
    => false
    irb(main):011:0> ems.errors.messages
    => {:guid=>["can't be blank"]}
    irb(main):012:0> ems.guid
    => nil
    if it rolled back, why did it still whack the guid?
    Adam Grare
    @agrare
    try ems.reload.guid maybe
    >> ems.guid = nil
    => nil
    >> ems.save
       (0.6ms)  BEGIN
      Tenant Load (0.8ms)  SELECT  "tenants".* FROM "tenants" WHERE "tenants"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
      Tenant Inst Including Associations (0.5ms - 1rows)
      Zone Load (0.8ms)  SELECT  "zones".* FROM "zones" WHERE "zones"."id" = $1 LIMIT $2  [["id", 2], ["LIMIT", 1]]
      Zone Inst Including Associations (0.3ms - 1rows)
       (0.5ms)  ROLLBACK
    => false
    >> ems.guid
    => nil
    >> ems.reload.guid
    => "2f6baf30-8f69-480e-a7a1-04d9782019e9"
    Daniel Berger
    @djberg96
    interesting
    is there a way to accomplish that in the UI?
    Adam Grare
    @agrare
    accomplish what?
    ems.reload
    Daniel Berger
    @djberg96
    yes
    Martin Hradil
    @himdel
    why would you need that? If saving fails, you return a flash message, and don't use the model object any more.
    if it suceeds, the model fits
    Adam Grare
    @agrare
    yeah I don't think that is the issue here, you have an object in memory with a nil guid but it never makes it to the db
    Daniel Berger
    @djberg96
    ah, ok, it's not actually modifying the database
    Adam Grare
    @agrare
    yeah that's why .reload is "bringing it back"
    Keenan Brock
    @kbrock
    wait - the model works like any other model. vm = Vm.find(1) ; vm.name="abc". vm in db is different but in memory looks like abc
    Adam Grare
    @agrare
    yes, that's why his ems.guid was nil in memory and not in the database
    so if I do
    Keenan Brock
    @kbrock
    yea - when it was first mentioned it seemed odd, but that is just how things work
    wonder why it is set to nil in memory though
    Adam Grare
    @agrare
    because save doesn't reload if it fails, it just leaves the object in memory the way it was
    Keenan Brock
    @kbrock
    heh - why did we set it to nil? I got why it was nil in memory if we set it. just curious why we would set it to nil
    Adam Grare
    @agrare
    I'm putting :moneybag: on someone created or updated this manually in postgres