Sha256: de30e35d4e1dcf821a249a83b34a7f74d216cfa5c70949fad1fb357fc9cad552
Contents?: true
Size: 788 Bytes
Versions: 1
Compression:
Stored size: 788 Bytes
Contents
require "easy_presenter/version" require "easy_presenter/base" require "easy_presenter/railtie" 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 end end # for the Presenter module only class << self def controller RequestStore.store[:presenter_controller] end def controller=(presenter_controller) RequestStore.store[:presenter_controller] = presenter_controller end end end if defined?(ActiveRecord::Base) ActiveRecord::Base.send :include, EasyPresenter elsif defined?(Mongoid::Document) Mongoid::Document.send :include, EasyPresenter end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
easy_presenter-1.0.0 | lib/easy_presenter.rb |