Hi,

I have a query like this:

item = Product.select(:description, :info).where(x: 1).first

Now, What I want to do is modify "description" and "info" fields before 
sending it to the browser/client. Here is my attempt:

class Product < Sequel::Model
   def description
      description + 'My modification at end'
   end

   def info
      'override string'
   end
end

And when I test like this:

puts item.info #> 'override string'

I get correct modified value BUT problem is when I send this to browser via 
Hash or JSON then original values are sent. I still get old values instead 
of my modified values.

How can I make my modifications and changes "permanent" when model is 
converted to hash or json?

Thanks,
-Den.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/f6f635a1-95d8-4e15-aa01-022c7cc80da1n%40googlegroups.com.

Reply via email to