Sha256: d6acc3f48efd5c40cd5c0ee568db0297bcd5fdded84efc2b7af802d6f1c7cd01

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

class Admin::Kitsune::KitsuneController < Admin::Kitsune::ApplicationController
  before_filter :load_models
  skip_before_filter :verify_authenticity_token
  private
  def load_models
    models = Kitsune.models_with_admin.map{ |m| Kitsune::Inspector.new(m) }
    category_map = {}
    
    @models =[]
    models.each do |m|
      if m.category
        category_map[m.category] = [] unless category_map[m.category]
        category_map[m.category] << m
      else
        @models << m
      end
    end
    @models += category_map.to_a.map{|c| Hash[*c]}
    #@models = models
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kitsune-0.1.0 app/controllers/admin/kitsune/kitsune_controller.rb
kitsune-0.0.19 app/controllers/admin/kitsune/kitsune_controller.rb
kitsune-0.0.18 app/controllers/admin/kitsune/kitsune_controller.rb
kitsune-0.0.17 app/controllers/admin/kitsune/kitsune_controller.rb