Coder Social home page Coder Social logo

hayfork's People

Contributors

boblail avatar kobsy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hayfork's Issues

Allow Hayfork to work with associations without explicitly creating the mirror triggers

The README points out how a second foreach block must be defined when working with associations; and that this is not adequate:

Hayfork.maintain(Haystack) do
  foreach(Book) do
    insert(:title)
    insert(author: :name)
  end
end

Instead, Hayfork could automatically define triggers based on insert(author: :name) to watch authors and repopulate the haystack.

While implementing this technique, we should decide between two paths for how Hayfork handles has_many associations. In the event that one of an article's comments is updated, we could either:

  1. Wipe out all the comments entries for that post and regenerate all of them
  2. Surgically replace just the entries for the updated comment

The latter is how the README's example currently works; but combining the former strategy with #1 would also remove the need for a ref_id column.

Allow Hayfork to work with multiple fields without adding a custom column

The README points out how field must be added to get this example to work:

Hayfork.maintain(Haystack) do
  foreach(Employee) do
    insert(:full_name)
    insert(:position)
    insert(:short_bio)
  end
end

Instead, Hayfork could entirely encapsulate its ability to delete the right rows from the haystack.

One option would be to add a statement_id column to the haystack and to generate a unique ID for each statement (filename and line number?). This would also be useful for debugging since it would explain why a record is present in the haystack.

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.