Sha256: c53be45079006b5c2718dff16d91222eabb9fb1abf09b17a976545f24143027d
Contents?: true
Size: 677 Bytes
Versions: 2
Compression:
Stored size: 677 Bytes
Contents
module Lit class Locale < ActiveRecord::Base ## SCOPES scope :ordered, order('locale ASC') ## ASSOCIATIONS has_many :localizations, :dependent=>:destroy ## VALIDATIONS validates :locale, :presence=>true, :uniqueness=>true ## ACCESSIBLE attr_accessible :locale def to_s self.locale end def get_translated_percentage self.get_changed_localizations_count * 100 / self.get_all_localizations_count end def get_changed_localizations_count self.localizations.changed.count(:id) end def get_all_localizations_count self.localizations.count(:id) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lit-0.0.3.1 | app/models/lit/locale.rb |
lit-0.0.3 | app/models/lit/locale.rb |