Sha256: 17fdca1a1a2a36fc6610fcc0e65c1feaf84677da473f8c1df6dd9b969bdc0223

Contents?: true

Size: 227 Bytes

Versions: 8

Compression:

Stored size: 227 Bytes

Contents

# add `valid_locale?` method to validate locale with globalize
module Globalize
  mattr_accessor :available_locales

  def self.valid_locale?(loc)
    return false unless loc
    available_locales.include?(loc.to_sym)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ab_admin-0.8.3 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.8.2 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.8.1 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.8.0 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.7.0 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.6.1 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.6.0 lib/ab_admin/hooks/globalize_valid_locale.rb
ab_admin-0.5.0 lib/ab_admin/hooks/globalize_valid_locale.rb