klass_name_types 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ class KlassNameType < ActiveRecord::Base
3
3
  acts_as_constant
4
4
 
5
5
  validates_presence_of :name
6
- validates_uniqueness_of :name
6
+ validates_uniqueness_of :name, :case_sensitive => true
7
7
  validates_length_of :name, :maximum => 100
8
8
 
9
9
  def self.create_knt_table
@@ -19,9 +19,12 @@ class << ActiveRecord::Base
19
19
  end
20
20
 
21
21
  unless m_flag
22
- if KlassNameType.create(:name => c_name)
23
- # puts "Created KlassNameType: #{c_name}"
24
- KlassNameType.reload_constants!
22
+ knt = KlassNameType.find_by_name(c_name)
23
+ unless knt
24
+ if KlassNameType.create(:name => c_name)
25
+ # puts "Created KlassNameType: #{c_name}"
26
+ KlassNameType.reload_constants!
27
+ end
25
28
  end
26
29
  end
27
30
  end
@@ -2,4 +2,4 @@
2
2
  gem_name: klass_name_types
3
3
  package: klass_name_types
4
4
  project: magrathea
5
- version: 1.0.5
5
+ version: 1.0.6
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: klass_name_types
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.5
7
- date: 2007-09-21 00:00:00 -04:00
6
+ version: 1.0.6
7
+ date: 2007-10-23 00:00:00 -04:00
8
8
  summary: klass_name_types
9
9
  require_paths:
10
10
  - lib