Skip to content
Browse files

remove rails 2 generator support

  • Loading branch information...
1 parent 1686b60 commit ab30fdeaeddd42ad61b7a486353ac8d72ec6ebe0 @artemk artemk committed Dec 9, 2011
View
15 README.rdoc
@@ -18,13 +18,15 @@ was used.
=== Rails 2.3.x
-The last version of gem that is compatible with Rails 2.3.x is 2.1.0.
+To use it, add it to your Gemfile:
+
+ gem 'acts-as-taggable-on', '2.1.0'
=== Rails 3.x
To use it, add it to your Gemfile:
- gem 'acts-as-taggable-on', '~>2.1.0'
+ gem 'acts-as-taggable-on'
==== Post Installation
@@ -67,7 +69,7 @@ compatibility with the will_paginate gem:
class User < ActiveRecord::Base
acts_as_taggable_on :tags, :skills
- named_scope :by_join_date, :order => "created_at DESC"
+ scope :by_join_date, order("created_at DESC")
end
User.tagged_with("awesome").by_date
@@ -82,6 +84,8 @@ compatibility with the will_paginate gem:
# Find a user with any of tags based on context:
User.tagged_with(['awesome, cool'], :on => :tags, :any => true).tagged_with(['smart', 'shy'], :on => :skills, :any => true)
+ Note: User.tagged_with([]) or '' will return [], but not all records.
+
=== Relationships
You can find objects of the same type based on similar tags on certain contexts.
@@ -173,11 +177,6 @@ CSS:
.css3 { font-size: 1.4em; }
.css4 { font-size: 1.6em; }
-== Why TaggableModel.joins(:tags) doesn't work (only for Rails >=3.0.10)?
-
-When you define acts_as_taggable_on in your model it add <tt>has_many :through</tt> associations to your model. In this +has_many+ declaration we join 'tags' table using rails ":include" statement, also we use additional ":conditions" statement where we refer to joined 'tags' table. In rails 3.0.10 they changed logic, and {now}[https://github.com/rails/rails/commit/caec63929fabe0368da71128c96e74c174791eb9] <tt>joins</tt> which is mode on model, substitutes 'include' from has_many declaration and place 'joins' at the end of sql, after 'conditions'. So Joining is happened but after 'Where'.
-While we are trying to figure out how to fix this, please use Rails 3.0.9 or don't use Model.joins(:tags)
-
== Contributors
We have a long list of valued contributors. {Check them all}[https://github.com/mbleigh/acts-as-taggable-on/contributors]
View
7 generators/acts_as_taggable_on_migration/acts_as_taggable_on_migration_generator.rb
@@ -1,7 +0,0 @@
-class ActsAsTaggableOnMigrationGenerator < Rails::Generator::Base
- def manifest
- record do |m|
- m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "acts_as_taggable_on_migration"
- end
- end
-end
View
29 generators/acts_as_taggable_on_migration/templates/migration.rb
@@ -1,29 +0,0 @@
-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

0 comments on commit ab30fde

Please sign in to comment.
Something went wrong with that request. Please try again.