Skip to content

Instantly share code, notes, and snippets.

@adelevie
Created December 16, 2011 21:27
Show Gist options
  • Save adelevie/1488065 to your computer and use it in GitHub Desktop.
Save adelevie/1488065 to your computer and use it in GitHub Desktop.
parse_resource ORM adapter for Devise
#require 'orm_adapter/adapters/mongo_mapper'
module Devise
module Orm
module ParseResource
extend ActiveSupport::Concern
included do
extend Devise::Models
extend Devise::Orm::ParseResource::Hook
end
module Hook
def devise_modules_hook!
extend Schema
yield
return unless Devise.apply_schema
devise_modules.each { |m| send(m) if respond_to?(m, true) }
end
end
module Schema
include Devise::Schema
# Tell how to apply schema methods
def apply_devise_schema(name, type, options={})
#type = Time if type == DateTime
#key(name, type, options)
field(name)
end
end
end
end
end
ParseResource::Base.extend Devise::Models
ParseResource::Base.send :include, Devise::Orm::ParseResource::Schema
#ActiveRecord::ConnectionAdapters::Table.send :include, Devise::Orm::ActiveRecord::Schema
#ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Orm::ActiveRecord::Schema
@timigod
Copy link

timigod commented Oct 15, 2015

Hey,
I stumbled upon this when I was looking for a way to use Devise and Parse Resource.
Does it work?
How does one implement it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment