rails new YourProject --skip-active-record
In your Gemfile, remove the database driver gem, e.g. gem 'sqlite3' or gem 'pg'.
In config/application.rb, replace require 'rails/all' with
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
config.active_record.migration_error = :page_load
you have to remove active_record helpers from the spec_helper
config.app_middleware.delete "ActiveRecord::ConnectionAdapters::ConnectionManagement"
gem 'neo4j', github: 'neo4jrb/neo4j' # in Gemfile
default: &default
type: server_db
url: http://neo4j:password@localhost:7474
development:
<<: *default
test:
<<: *default
production:
<<: *default
Used Devise
Used Pundit
Issue Namespace Issue
policy/dashboard/home_policy.rb
module Dashboard
class HomePolicy < DashboardPolicy
def initialize(user, record)
@user = user
@record = record
end
def show?
@user.present?
end
end
end
policy/home_policy.rb
class HomePolicy < ApplicationPolicy
def initialize(user, record)
@user = user
@record = record
end
def show?
true
end
end
dashboard/home_controller.rb
def show
# send name of controller, which is the policy's qualifying name.
# and that's it voila.
authorize :"#{params[:controller]}", :show?
end