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.
- checksums.yaml +4 -4
- data/.travis.yml +13 -4
- data/Appraisals +8 -4
- data/CHANGELOG.md +47 -0
- data/Gemfile +7 -1
- data/README.md +21 -11
- data/Rakefile +21 -3
- data/UPGRADING +7 -0
- data/acts-as-taggable-on.gemspec +5 -5
- data/{lib/generators/acts_as_taggable_on/migration/templates/active_record/migration.rb → db/migrate/1_acts_as_taggable_on_migration.rb} +0 -0
- data/db/migrate/2_add_missing_unique_indices.rb +21 -0
- data/gemfiles/{rails_3.gemfile → rails_3.2.gemfile} +1 -2
- data/gemfiles/rails_4.0.gemfile +7 -0
- data/gemfiles/rails_4.1.gemfile +7 -0
- data/lib/acts-as-taggable-on.rb +9 -13
- data/lib/acts_as_taggable_on.rb +6 -0
- data/lib/acts_as_taggable_on/acts_as_taggable_on/cache.rb +49 -20
- data/lib/acts_as_taggable_on/acts_as_taggable_on/collection.rb +42 -32
- data/lib/acts_as_taggable_on/acts_as_taggable_on/compatibility.rb +1 -1
- data/lib/acts_as_taggable_on/acts_as_taggable_on/core.rb +24 -13
- data/lib/acts_as_taggable_on/engine.rb +6 -0
- data/lib/acts_as_taggable_on/tag.rb +27 -7
- data/lib/acts_as_taggable_on/taggable.rb +6 -6
- data/lib/acts_as_taggable_on/tagger.rb +6 -6
- data/lib/acts_as_taggable_on/tags_helper.rb +1 -1
- data/lib/acts_as_taggable_on/version.rb +1 -1
- data/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb +4 -71
- data/spec/acts_as_taggable_on/acts_as_tagger_spec.rb +19 -19
- data/spec/acts_as_taggable_on/caching_spec.rb +77 -0
- data/spec/acts_as_taggable_on/tags_helper_spec.rb +10 -10
- data/spec/schema.rb +25 -21
- data/spec/spec_helper.rb +9 -25
- metadata +40 -56
- data/gemfiles/rails_4.gemfile +0 -8
- data/lib/generators/acts_as_taggable_on/migration/migration_generator.rb +0 -39
- data/spec/generators/acts_as_taggable_on/migration/migration_generator_spec.rb +0 -22
data/gemfiles/rails_4.gemfile
DELETED
@@ -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
|