Git Product home page Git Product logo

Comments (2)

jhawthorn avatar jhawthorn commented on August 22, 2024 1

Thanks for the issue!

Possibly should be done as a separate gem in addition to discard?

I'd prefer this.

I'd like to keep discard really small, and not have it grow much bigger than it is now. (It really doesn't do much, it's more a set of conventions than a real tool).

I'm open to making changes which make a mongoid integration easier so long as they don't add much complexity. (If much complexity is required, it would probably be best for users of both AR and mongoid to just have a totally separate fork)

adjust the scopes to work with Mongoid

I'd be okay with moving Discard::Model::ClassMethods into a different class like Discard::Scopes. With this we could add something like extend Discard::Scopes if self < ActiveRecord::Base to the included block (perhaps something more explicit, but I do want to follow SemVer strictly and not change that API)

changing the activerecord dependency to activesupport

Changing it to activemodel is 👍 by me, so long as we also make the change to the scopes I describe above (the scopes do make ActiveRecord required).

add Mongoid field field discard_column, type: Time in the included block of Discard::Model - needs to be done in a way that it doesn't break the ActiveRecord version

I'm not familiar with Mongoid or libraries for it, but I feel like it would be best to just explicitly declare the field. If declaring it implicitly is desired, as long as it is in the Mongoid-specific gem, that's 👍

from discard.

hobbypunk90 avatar hobbypunk90 commented on August 22, 2024

i know this issue is closed for a while, but today i ran in this problem 😁 (i had discard in gem list and it loads active record and i searched a while why activerecord is laoded - it maked me crazy 😁)
i forked and changed the gem. The changes are about 6 lines, only one scope didn't work with mongoid.

if it's ok for @jhawthorn i would like to create a merge request for the changes.

from discard.

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.