Last active
December 20, 2015 15:49
-
-
Save yaychris/6156829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SimplestAuth | |
module Model | |
def self.included(base) | |
adapters.each do |adapter| | |
if adapter.registered?(base) | |
include adapter | |
end | |
end | |
end | |
def self.adapters | |
Adapters.constants.map { |c| SimplestAuth::Model::Adapters.const_get(c) } | |
end | |
module Adapters | |
module ActiveRecord | |
def registered?(base) | |
# code to determine if ActiveRecord is being used | |
end | |
end | |
module DataMapper | |
def registered?(base) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment