Giter Club home page Giter Club logo

decoratex's Issues

Document and test usage on embedded schemas

Decoratex only reads data from existing fields in the struct model, and creates some virtual fields to store the calculated data.

Since fetching the required data for performing the calculations is external to Decorates, and must be done before running any decoration function, I think that it should also work with embedded schemas.

We could add some tests and update the documentation and examples to reflect this.

Refactor decorate methods

All decorate methods are added in the quote block of the main defmacro, so you can use it straight as a method of the schema module:

MyModule.decorate(my_module)

But the defmacro is to big and i'm not sure if include this methods to the schema module is a good choice.

Maybe the right way in a new mayor version is to add a new module inside the lib, and use it for an explicit decoration:

Decoratex.apply(my_module)

Question, best way to decorate with preloaded relations

Hi all, thank you for the hard work. I have a question.

Suppose that I have a decorated field in the Post schema, but then I do something like

def preload(users_query, preloads) do
   Users
   |> Repo.all()
   |> Repo.preload(preloads)
end

where preloads is dynamic, and could be i.e. [:posts, :comments, :likes, ...]

Which is the correct way to work in cases where you preload the relations, and those relations have decorated fields?

Thank you!

undefined function __decorations__/0

if I add "use Decoratex" to web.ex, those models doesn't have define function "decorators" raise "CompileError, undefined function decorations/0"

Project lacks changelog

This project lacks a changelog. This would be a helpful addition for tracking changes, especially breaking changes like those in v1.1.0.

Unmaintained?

Hello,

Is this repo unmaintained? It doesn't seem to work Ecto 3.x.

Cheers

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.