Skip to content

Commit

Permalink
drop support for Rails < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiek1507 committed Jul 1, 2016
1 parent 80f5966 commit a92da33
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 52 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ env:
- DB=postgresql

gemfile:
- gemfiles/activerecord_3.2.gemfile
- gemfiles/activerecord_4.0.gemfile
- gemfiles/activerecord_4.1.gemfile

Expand All @@ -28,9 +27,3 @@ matrix:
allow_failures:
- gemfile: gemfiles/activerecord_edge.gemfile
- rvm: rbx-2
exclude:
- rvm: 2.2
gemfile: gemfiles/activerecord_3.2.gemfile
- rvm: rbx-2
gemfile: gemfiles/activerecord_3.2.gemfile

4 changes: 0 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
appraise "activerecord-3.2" do
gem "activerecord", github: "rails/rails" , branch: '3-2-stable'
end

appraise "activerecord-4.0" do
gem "activerecord", github: "rails/rails" , branch: '4-0-stable'
end
Expand Down
2 changes: 1 addition & 1 deletion acts-as-taggable-on.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
gem.post_install_message = File.read('UPGRADING.md')
end

gem.add_runtime_dependency 'activerecord', ['>= 3.2', '< 5']
gem.add_runtime_dependency 'activerecord', ['>= 4.0', '< 5']

gem.add_development_dependency 'sqlite3'
gem.add_development_dependency 'mysql2', '~> 0.3.7'
Expand Down
15 changes: 0 additions & 15 deletions gemfiles/activerecord_3.2.gemfile

This file was deleted.

8 changes: 2 additions & 6 deletions lib/acts_as_taggable_on/compatibility.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module ActsAsTaggableOn::Compatibility
def has_many_with_taggable_compatibility(name, options = {}, &extention)
if ActsAsTaggableOn::Utils.active_record4? || ActsAsTaggableOn::Utils.active_record5?
scope, opts = build_taggable_scope_and_options(options)
has_many(name, scope, opts, &extention)
else
has_many(name, options, &extention)
end
scope, opts = build_taggable_scope_and_options(options)
has_many(name, scope, opts, &extention)
end

def build_taggable_scope_and_options(opts)
Expand Down
11 changes: 0 additions & 11 deletions lib/acts_as_taggable_on/tagging.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
module ActsAsTaggableOn
class Tagging < ::ActiveRecord::Base #:nodoc:
#TODO, remove from 4.0.0
attr_accessible :tag,
:tag_id,
:context,
:taggable,
:taggable_type,
:taggable_id,
:tagger,
:tagger_type,
:tagger_id if defined?(ActiveModel::MassAssignmentSecurity)

belongs_to :tag, class_name: '::ActsAsTaggableOn::Tag', counter_cache: ActsAsTaggableOn.tags_counter
belongs_to :taggable, polymorphic: true
belongs_to :tagger, polymorphic: true
Expand Down
1 change: 0 additions & 1 deletion spec/acts_as_taggable_on/taggable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,6 @@

context 'Model.limit(x).tag_counts.sum(:tags_count)' do
it 'should not break on Mysql' do
# Activerecord 3.2 return a string
expect(TaggableModel.limit(2).tag_counts.sum('tags_count').to_i).to eq(5)
end
end
Expand Down
8 changes: 1 addition & 7 deletions spec/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@
config = ActiveRecord::Base.configurations[db_name]

begin
#activerecord 4 uses symbol
#TODO, remove when activerecord 3 support is dropped
if ActsAsTaggableOn::Utils.active_record4? || ActsAsTaggableOn::Utils.active_record5?
ActiveRecord::Base.establish_connection(db_name.to_sym)
else
ActiveRecord::Base.establish_connection(db_name)
end
ActiveRecord::Base.establish_connection(db_name.to_sym)
ActiveRecord::Base.connection
rescue
case db_name
Expand Down

0 comments on commit a92da33

Please sign in to comment.