0 Replies Latest reply on Apr 10, 2014 6:36 PM by Marcus Atkins

    Remove fields from a RHOM find call

    Marcus Atkins

      Overall goal:

           Create a JSON string with only the required field to be sent to a web service.

       

      Problem explanation:

           The information being sent is from the database and uses property bag. I use the following command to get the records:


               model.find(:all, :select => [field1, ... ,fieldN]).to_json


           This all works well, apart from the fact that the two fields source_id and object are contained in response to the above find call.

       

           I can convert the RHOM model to hash only extracting the correct field, however this feels like a hack to me. I am curious as to what      your thoughts are regarding this.

       

      Question that needs to be discussed/answered:

           What would be the tidiest way of 'removing' those two fields?