Skip to content

Commit

Permalink
Restore back Ruby 2.0 support
Browse files Browse the repository at this point in the history
Postponing until next major release.
Refs. efff66d
  • Loading branch information
mshibuya committed Jun 30, 2018
1 parent f15f4ba commit bed4f17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .travis.yml
Expand Up @@ -27,6 +27,12 @@ before_script:

matrix:
include:
- rvm: 2.0
gemfile: gemfiles/rails-4-0.gemfile
- rvm: 2.0
gemfile: gemfiles/rails-4-1.gemfile
- rvm: 2.0
gemfile: gemfiles/rails-4-2.gemfile
- rvm: 2.1.10
gemfile: gemfiles/rails-4-0.gemfile
- rvm: 2.1.10
Expand Down
2 changes: 1 addition & 1 deletion carrierwave.gemspec
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.licenses = ["MIT"]

s.required_ruby_version = ">= 2.1.0"
s.required_ruby_version = ">= 2.0.0"

s.add_dependency "activesupport", ">= 4.0.0"
s.add_dependency "activemodel", ">= 4.0.0"
Expand Down
9 changes: 9 additions & 0 deletions lib/carrierwave/uploader.rb
Expand Up @@ -43,6 +43,15 @@ module Uploader
class Base
attr_reader :file

##
# Workaround for class_attribute malfunction when used with Module#prepend
#
if RUBY_VERSION < '2.1.0'
def self.singleton_class?
!ancestors.include? self
end
end

include CarrierWave::Uploader::Configuration
include CarrierWave::Uploader::Callbacks
include CarrierWave::Uploader::Proxy
Expand Down

0 comments on commit bed4f17

Please sign in to comment.