Merge branch 'ticket/unstable/720-tagging' into unstable
This commit is contained in:
commit
4b5d4307d2
2
Gemfile
2
Gemfile
@ -1,3 +1,4 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
source :rubygems
|
source :rubygems
|
||||||
|
|
||||||
gem "rails", "2.3.14"
|
gem "rails", "2.3.14"
|
||||||
@ -7,6 +8,7 @@ gem "i18n", "~> 0.4.2"
|
|||||||
gem "rubytree", "~> 0.5.2", :require => 'tree'
|
gem "rubytree", "~> 0.5.2", :require => 'tree'
|
||||||
gem "rdoc", ">= 2.4.2"
|
gem "rdoc", ">= 2.4.2"
|
||||||
gem "liquid", "~> 2.3.0"
|
gem "liquid", "~> 2.3.0"
|
||||||
|
gem "acts-as-taggable-on", "= 2.1.0"
|
||||||
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
|
# Needed only on RUBY_VERSION = 1.8, ruby 1.9+ compatible interpreters should bring their csv
|
||||||
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
|
gem "fastercsv", "~> 1.5.0", :platforms => [:ruby_18, :jruby, :mingw_18]
|
||||||
|
|
||||||
|
29
db/migrate/20111125191432_acts_as_taggable_on_migration.rb
Normal file
29
db/migrate/20111125191432_acts_as_taggable_on_migration.rb
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
class ActsAsTaggableOnMigration < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
create_table :tags do |t|
|
||||||
|
t.column :name, :string
|
||||||
|
end
|
||||||
|
|
||||||
|
create_table :taggings do |t|
|
||||||
|
t.column :tag_id, :integer
|
||||||
|
t.column :taggable_id, :integer
|
||||||
|
t.column :tagger_id, :integer
|
||||||
|
t.column :tagger_type, :string
|
||||||
|
|
||||||
|
# You should make sure that the column created is
|
||||||
|
# long enough to store the required class names.
|
||||||
|
t.column :taggable_type, :string
|
||||||
|
t.column :context, :string
|
||||||
|
|
||||||
|
t.column :created_at, :datetime
|
||||||
|
end
|
||||||
|
|
||||||
|
add_index :taggings, :tag_id
|
||||||
|
add_index :taggings, [:taggable_id, :taggable_type, :context]
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :taggings
|
||||||
|
drop_table :tags
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user