Sha256: 561a5a1aec765c43758079a02f2ecb5730045eb4978ab90bdb4666e7e286215c

Contents?: true

Size: 497 Bytes

Versions: 15

Compression:

Stored size: 497 Bytes

Contents

class Status < ActiveRecord::Base
  has_many :pages
  attr_accessible :system_id, :name, :value, :user_id, :order_by, :is_default, :is_published, :is_stub

  @@statuses = {}

  def Status.method_missing(m, *args, &block)
    if m=~/(.*)_status$/
      status = $1
      sys_id = args[0]
      key = "#{sys_id}.#{status}"
      s = @@statuses[key]
      return s if s
      @@statuses[key] = Status.sys(sys_id).where("is_#{status} = 1").first
    else
      super(m, args, block)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
kit_cms-2.3.22 app/models/status.rb
kit_cms-2.3.20 app/models/status.rb
kit_cms-2.3.19 app/models/status.rb
kit_cms-2.3.18 app/models/status.rb
kit_cms-2.3.17 app/models/status.rb
kit_cms-2.3.16 app/models/status.rb
kit_cms-2.3.15 app/models/status.rb
kit_cms-2.3.14 app/models/status.rb
kit_cms-2.3.13 app/models/status.rb
kit_cms-2.3.11 app/models/status.rb
kit_cms-2.3.10 app/models/status.rb
kit_cms-2.3.9 app/models/status.rb
kit_cms-2.3.8 app/models/status.rb
kit_cms-2.3.7 app/models/status.rb
kit_cms-2.3.6 app/models/status.rb