Code Monkey home page Code Monkey logo

Comments (8)

yahor avatar yahor commented on August 16, 2024

@jekhor Усё тут падаецца правільна. скоп маделі(метад класса) і метады інстанса класа active?

User.active != user.active?
розныя аб'екты і розныя метады.
У якім месцы кода блытаніна?

from hackerspace.by.

jekhor avatar jekhor commented on August 16, 2024

Мне калі трэба атрымаць спіс дзейсных на дадзены момант юзэраў (не забаненых і не ў саспендзе), то я, убачыўшы метад User.active і ведаючы пра User#active?, проста ні на секунду не буду сумнявацца, што User.active — як раз тое, што мне трэба. А насамрэч не.

from hackerspace.by.

jekhor avatar jekhor commented on August 16, 2024

https://github.com/minsk-hackerspace/hackerspace.by/blob/master/app/models/user.rb#L156 напрыклад

from hackerspace.by.

jekhor avatar jekhor commented on August 16, 2024

семантыка розная.

from hackerspace.by.

yahor avatar yahor commented on August 16, 2024

ага, цяпер бачу што не зусім празрыста ўнутры.

трэба рэфакторыць або проста увесці flag які будзе ставіцца актыўнамую юзеру як true і табы будзе менш выбараць і іфчыкаў.

def self.active
(allowed.paid + allowed.signed_in).uniq
end

from hackerspace.by.

jekhor avatar jekhor commented on August 16, 2024

Ну мне падаецца, што непатрэбна нам тая сартыроўка па "актыўнасці" юзэраў, якую калісьці праз гэта рабілі ў спісе ўдзельнікаў.

from hackerspace.by.

yahor avatar yahor commented on August 16, 2024

так, пасля саспенд логікі прыйшоў час пераглядзець гэта.

from hackerspace.by.

yahor avatar yahor commented on August 16, 2024

Зрабіў змены тут #577

from hackerspace.by.

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.