veezus/vurl — comment on commit a7886fbc938a15a1522ce807c38b7dd2a6405676
File: spec/models/vurl_spec.rb line 53
By nfedyashev:

@veezus

We're using Vurl with custom domain and access it only from API interface.
The task was simple - any further vurl slugs must have at least 4-characters(project requirement).

So my first idea was to look at tests. These lines:

+ zz = Fabricate(:vurl)
+ zz.update_attribute(:slug, 'ZZ')
+ aaa = Fabricate(:vurl)
+ aaa.slug.should == 'AAA'

gives instant feeling "I know how it works inside! I don't even need to look at source!" :)

So the solution was as simple as:

Vurl.last.update_attribute(:slug, 'ZZZ')