Sha256: 4324ae2292523cfcac36e30d350be0649a39d28b52c074e5f1d3ba99f0c9dcfa

Contents?: true

Size: 291 Bytes

Versions: 6

Compression:

Stored size: 291 Bytes

Contents

class Category < ActiveRecord::Base
  attr_accessible :name, :parent_id

  has_many :categories, :foreign_key => :parent_id
  belongs_to :parent, :foreign_key => :parent_id, :class_name => "Category"

  def self.token_json(items)
    items.map{|i| {:id => i.id, :name => i.name} }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
token_field-1.1.0 spec/dummy/app/models/category.rb
token_field-1.0.1 spec/dummy/app/models/category.rb
token_field-1.0.0 spec/dummy/app/models/category.rb
token_field-0.0.3 spec/dummy/app/models/category.rb
token_field-0.0.2 spec/dummy/app/models/category.rb
token_field-0.0.1 spec/dummy/app/models/category.rb