lib/easy_presenter.rb in easy_presenter-1.0.0 vs lib/easy_presenter.rb in easy_presenter-1.0.1
- old
+ new
@@ -4,14 +4,22 @@
module EasyPresenter
extend ActiveSupport::Concern
included do
- presenter_class = "#{self}Presenter".safe_constantize
- if presenter_class
- include Base
- presenter_class.extend ActiveSupport::Concern
- include presenter_class
+ easy_presenter_subclass
+ end
+
+ module ClassMethods
+ protected
+ def easy_presenter_subclass
+ presenter_class = "#{self}Presenter".safe_constantize
+ if presenter_class
+ presenter_class.extend ActiveSupport::Concern
+ include presenter_class
+ include Base
+ end
+ presenter_class
end
end
# for the Presenter module only
class << self
\ No newline at end of file