Sha256: 4b35a218111d7e696c6e393799d701ed248fbd801b075061c44419d1b70844d6

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require 'rubygems'
require 'activerecord'
require File.dirname(__FILE__)+'/../lib/is_taggable'
require 'expectations'
require 'logger'

ActiveRecord::Base.configurations = {'sqlite3' => {:adapter => 'sqlite3', :database => ':memory:'}}
ActiveRecord::Base.establish_connection('sqlite3')

ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.logger.level = Logger::WARN

ActiveRecord::Schema.define(:version => 0) do
  create_table :comments do |t|
  end
  
  create_table :posts do |t|
    t.string  :title, :default => ''
  end

  create_table :pages do |t|
    t.string :title, :default => ''
  end

  create_table :tags do |t|
    t.string :name, :default => ''
    t.string :kind, :default => '' 
  end

  create_table :taggings do |t|
    t.integer :tag_id

    t.string  :taggable_type, :default => ''
    t.integer :taggable_id
  end
end

class Post < ActiveRecord::Base
  is_taggable :tags, :languages
end

class Comment < ActiveRecord::Base
  is_taggable
end

class Page < ActiveRecord::Base
  is_taggable :categories, :fixed => true
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bdimcheff-is_taggable-0.1.0 test/test_helper.rb
bdimcheff-is_taggable-0.1.1 test/test_helper.rb