Sign in

EDIT / kanjai · Files

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • Network
  • kanjai
  • app
  • models
  • kanjai
  • page_lang.rb
  • first relize
    a433119a
    Karpikau Andrei authored
    2016-04-27 16:33:32 +0300  
    Browse Files »
page_lang.rb 313 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
module Kanjai
  class PageLang < ActiveRecord::Base

    validates :code, :title, presence: true

    default_scope { order('code') }

    def self.default
      obj = PageLang.where(:default_use => true).first
      if obj.nil?
        return 'en'
      else
        return obj.code
      end
    end


  end
end