I have a test case that demonstrates the issue now...
describe 'Copy Integrity' do
it 'remains unique' do
z = create :zid
i = create :identity, zid_id: z.key
Identity.find_by_index('zid_id', z.key).count.should eq(1)
i.email = 'uni...@unique.com'
i.save
Identity.find_by_index('zid_id', z.key).count.should eq(1)
end
end
The answer at bottom is 2, not 1.
On Dec 7, 2012, at 9:19 AM, Martin Streicher wrote:
>
> Thanks for the help earlier this week. I have an odd question...
>
> I have an Identity model being used with Omniauth::Identity. All is well --
> when someone registers, the credentials (email and encrypted password) are
> saved in Riak.
>
> However, if in some other code, I retrieve an Identity record by an indexed
> field and save it, a copy of the record seems to crop up with the new email
> field value.
>
> @identity = Identity.find_by_index('zid_id', @zid.key).first
> @identity.email = params[:profile][:email]
> @identity.save
>
> In other words, if I start with record A, I get A and now B, where B's email
> field is different.
>
> Ideas?
>
>
>
>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com