Skip to content

Comment on Show HN: A gem to stop progressively building ActiveRecord queriesparent

Comments

It'll do too, but I think it's nice to abstract the http-layer completely away from the view.

In case you want to replicate, I believe the relevant part is simply adding this to the base class:

    extend ActiveModel::Naming
    include ActiveModel::AttributeMethods
    def to_key
      []
    end
And then add `attr_reader` for each field.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.