Just a small tidy up that I thought I'd pass on. Juixe::Acts::Commentable was being included in AR::Base with a ClassMethods module, and this ClassMethods module was being extended on AR::Base when the Commentable module was included:
module Commentable
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
# ...
end
end
ActiveRecord::Base.send(:include, Commentable)
This is unnecessary indirection because you can just extend the module in the first place and do away with the ClassMethods module and the self.included method, a la:
module Commentable
# ...
end
ActiveRecord::Base.send(:extend, Commentable)
I also couldn't get the test suite running with Ruby 2.1.1 out of the box, so I've included what was necessary for me to get the suite green, which was:
Add test-unit to development gems
Change Rails.version.first to Rails::VERSION::MAJOR because String#first is a ActiveSupport extension
Added require 'rails/version' to be able to get Rails::VERSION ...
Just a small tidy up that I thought I'd pass on. Juixe::Acts::Commentable was being included in AR::Base with a ClassMethods module, and this ClassMethods module was being extended on AR::Base when the Commentable module was included:
This is unnecessary indirection because you can just extend the module in the first place and do away with the ClassMethods module and the self.included method, a la:
I also couldn't get the test suite running with Ruby 2.1.1 out of the box, so I've included what was necessary for me to get the suite green, which was: