fast_gettext 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.4
1
+ 0.5.5
data/fast_gettext.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fast_gettext}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
@@ -17,12 +17,19 @@ module FastGettext::TranslationRepository
17
17
  @@available_locales ||= TranslationText.count(:group=>:locale).keys.sort
18
18
  end
19
19
 
20
- #this is only for ActiveSupport to get polymorphic_url FastGettext::... namespace free
20
+ # get polymorphic_url FastGettext::... namespace free
21
+ # !! copied in translation_text.rb
22
+ def self.name
23
+ 'TranslationKey'
24
+ end
25
+
21
26
  def self.model_name
22
- if defined? ActiveSupport::ModelName
23
- ActiveSupport::ModelName.new('TranslationKey')
24
- else
25
- 'TranslationKey'
27
+ if defined? ActiveSupport::ModelName # Rails 2
28
+ ActiveSupport::ModelName.new(name)
29
+ elsif defined? ActiveModel::Name # Rails 3
30
+ ActiveModel::Name.new(self)
31
+ else # Fallback
32
+ name
26
33
  end
27
34
  end
28
35
  end
@@ -4,6 +4,22 @@ module FastGettext::TranslationRepository
4
4
  belongs_to :key, :class_name=>'TranslationKey'
5
5
  validates_presence_of :locale
6
6
  validates_uniqueness_of :locale, :scope=>:translation_key_id
7
+
8
+ # get polymorphic_url FastGettext::... namespace free
9
+ # !! copied in translation_key.rb
10
+ def self.name
11
+ 'TranslationKey'
12
+ end
13
+
14
+ def self.model_name
15
+ if defined? ActiveSupport::ModelName # Rails 2
16
+ ActiveSupport::ModelName.new(name)
17
+ elsif defined? ActiveModel::Name # Rails 3
18
+ ActiveModel::Name.new(self)
19
+ else # Fallback
20
+ name
21
+ end
22
+ end
7
23
  end
8
24
  end
9
25
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 4
9
- version: 0.5.4
8
+ - 5
9
+ version: 0.5.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser