acts-as-taggable-on 2.4.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -4
  3. data/Appraisals +8 -4
  4. data/CHANGELOG.md +47 -0
  5. data/Gemfile +7 -1
  6. data/README.md +21 -11
  7. data/Rakefile +21 -3
  8. data/UPGRADING +7 -0
  9. data/acts-as-taggable-on.gemspec +5 -5
  10. data/{lib/generators/acts_as_taggable_on/migration/templates/active_record/migration.rb → db/migrate/1_acts_as_taggable_on_migration.rb} +0 -0
  11. data/db/migrate/2_add_missing_unique_indices.rb +21 -0
  12. data/gemfiles/{rails_3.gemfile → rails_3.2.gemfile} +1 -2
  13. data/gemfiles/rails_4.0.gemfile +7 -0
  14. data/gemfiles/rails_4.1.gemfile +7 -0
  15. data/lib/acts-as-taggable-on.rb +9 -13
  16. data/lib/acts_as_taggable_on.rb +6 -0
  17. data/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb +49 -20
  18. data/lib/acts_as_taggable_on/acts_as_taggable_on/collection.rb +42 -32
  19. data/lib/acts_as_taggable_on/acts_as_taggable_on/compatibility.rb +1 -1
  20. data/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb +24 -13
  21. data/lib/acts_as_taggable_on/engine.rb +6 -0
  22. data/lib/acts_as_taggable_on/tag.rb +27 -7
  23. data/lib/acts_as_taggable_on/taggable.rb +6 -6
  24. data/lib/acts_as_taggable_on/tagger.rb +6 -6
  25. data/lib/acts_as_taggable_on/tags_helper.rb +1 -1
  26. data/lib/acts_as_taggable_on/version.rb +1 -1
  27. data/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb +4 -71
  28. data/spec/acts_as_taggable_on/acts_as_tagger_spec.rb +19 -19
  29. data/spec/acts_as_taggable_on/caching_spec.rb +77 -0
  30. data/spec/acts_as_taggable_on/tags_helper_spec.rb +10 -10
  31. data/spec/schema.rb +25 -21
  32. data/spec/spec_helper.rb +9 -25
  33. metadata +40 -56
  34. data/gemfiles/rails_4.gemfile +0 -8
  35. data/lib/generators/acts_as_taggable_on/migration/migration_generator.rb +0 -39
  36. data/spec/generators/acts_as_taggable_on/migration/migration_generator_spec.rb +0 -22
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal"
6
- gem "rails", :github => 'rails/rails'
7
-
8
- gemspec :path=>"../"
@@ -1,39 +0,0 @@
1
- require 'rails/generators'
2
- require 'rails/generators/migration'
3
-
4
- module ActsAsTaggableOn
5
- class MigrationGenerator < Rails::Generators::Base
6
- include Rails::Generators::Migration
7
-
8
- desc "Generates migration for Tag and Tagging models"
9
-
10
- def self.orm
11
- Rails::Generators.options[:rails][:orm]
12
- end
13
-
14
- def self.source_root
15
- File.join(File.dirname(__FILE__), 'templates', (orm.to_s unless orm.class.eql?(String)) )
16
- end
17
-
18
- def self.orm_has_migration?
19
- [:active_record].include? orm
20
- end
21
-
22
- def self.next_migration_number(dirname)
23
- if ActiveRecord::Base.timestamped_migrations
24
- migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
25
- migration_number += 1
26
- migration_number.to_s
27
- else
28
- "%.3d" % (current_migration_number(dirname) + 1)
29
- end
30
- end
31
-
32
- def create_migration_file
33
- if self.class.orm_has_migration?
34
- migration_template 'migration.rb', 'db/migrate/acts_as_taggable_on_migration'
35
- end
36
- end
37
- end
38
- end
39
-
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # Generators are not automatically loaded by Rails
4
- require 'generators/acts_as_taggable_on/migration/migration_generator'
5
-
6
- describe ActsAsTaggableOn::MigrationGenerator do
7
- # Tell the generator where to put its output (what it thinks of as Rails.root)
8
- destination File.expand_path("../../../../../tmp", __FILE__)
9
-
10
- before do
11
- prepare_destination
12
- Rails::Generators.options[:rails][:orm] = :active_record
13
- end
14
- describe 'no arguments' do
15
- before { run_generator }
16
-
17
- describe 'db/migrate/acts_as_taggable_on_migration.rb' do
18
- subject { file('db/migrate/acts_as_taggable_on_migration.rb') }
19
- it { should be_a_migration }
20
- end
21
- end
22
- end