On Tuesday, February 23, 2016 at 12:36:37 AM UTC-8, Stefan Slaveykov wrote:
>
> Hi,
>
> This example works fine! I`m starting to get confused :) I`m using 
> PostgreSQL 9.4.4.1
> It seems that every time i perform a db operation this messes up the json 
> formatted table. Given this method and it`s spec:
>
> def clear_session!
>     self.tokens = Sequel.pg_json({})
>     save(raise_on_failure: true)
> end
>
> describe '#clear_session!' do
>     let(:user) { build(:user_with_token) }
>     it 'clears all tokens for the user' do
>         puts user.token # this returns the properly formatted json colum
>         user.clear_session!
>         puts user.token # this returns "{}", instead of just {}
>         expect(user.tokens).to eq({}) # Fails
>     end
>   end
>

As I said previously, you need to create a minimal self-contained example 
that shows the problem you are having, similar to the example that I 
posted.  Without that I don't think I'll be able to help.

Thanks,
Jeremy

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to