is_unique 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/generators/is_unique/templates/is_unique_migration.rb +1 -1
- data/is_unique.gemspec +1 -1
- data/lib/is_unique.rb +1 -1
- data/spec/support/db.rb +1 -1
- data/spec/unique_model_spec.rb +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class <%= file_name.camelcase %> < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
add_column :<%= table_name %>, :<%= unique_hash_column %>, :string, :limit =>
|
3
|
+
add_column :<%= table_name %>, :<%= unique_hash_column %>, :string, :limit => 40
|
4
4
|
add_index :<%= table_name %>, :<%= unique_hash_column %>
|
5
5
|
# Generate hashes for existing records
|
6
6
|
<%= class_name %>.find_each { |r| r.save(false) }
|
data/is_unique.gemspec
CHANGED
data/lib/is_unique.rb
CHANGED
data/spec/support/db.rb
CHANGED
data/spec/unique_model_spec.rb
CHANGED
@@ -25,8 +25,8 @@ describe "A unique model" do
|
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
28
|
-
it 'should have a
|
29
|
-
subject.unique_hash.length.should ==
|
28
|
+
it 'should have a 40 characters long unique hash' do
|
29
|
+
subject.unique_hash.length.should == 40
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should not create a new record with the same attributes" do
|