Skip to content

json_fields: expose all fields plus additional methods  #12

Open
@marks

Description

@marks

I'm new to using mongoid-cached-json but so far it seems like exactly what I need - thank you!

I have a fairly complex model and I want .to_json to expose all of its key/values just as it did before I added mongoid-cached-json to the mix but also two methods (:definition => :method). When I do the following, .to_json starts to only expose the two defined methods.

Bottom line: trying to have it just add the defined fields to .to_json and not replace the existing contents. Ideas? Is that within scope of this project?

json_fields \
  :display_name => {:definition => :display_name},
  :display_id => {:definition => :display_id}

Many thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions