name space the rails things

This commit is contained in:
Rimian Perkins 2017-02-24 13:23:11 +11:00
parent 7d42f28666
commit 3a428d17f0
9 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
require_dependency 'discourse'
module DiscoursePayments
module DiscourseDonations
class ChargesController < ActionController::Base
include CurrentUser

View File

@ -1,4 +1,4 @@
module DiscoursePayments
module DiscourseDonations
class PaymentsController < ApplicationController
def index
render json: {}

View File

@ -1,5 +1,5 @@
module DiscoursePayments
module DiscourseDonations
module ApplicationHelper
end
end

View File

@ -1,4 +1,4 @@
DiscoursePayments::Engine.routes.draw do
DiscourseDonations::Engine.routes.draw do
resources :charges, only: [:create]
get 'users/:username/payments' => 'payments#show'
end

View File

@ -0,0 +1,6 @@
module ::DiscourseDonations
class Engine < ::Rails::Engine
engine_name 'discourse-donations'
isolate_namespace DiscourseDonations
end
end

View File

@ -1,6 +0,0 @@
module ::DiscoursePayments
class Engine < ::Rails::Engine
engine_name 'discourse-payments'
isolate_namespace DiscoursePayments
end
end

View File

@ -6,7 +6,7 @@
gem 'stripe', '2.0.1'
load File.expand_path('../lib/discourse_payments/engine.rb', __FILE__)
load File.expand_path('../lib/discourse_donations/engine.rb', __FILE__)
load File.expand_path('../config/stripe.rb', __FILE__)
after_initialize do
@ -26,5 +26,5 @@ after_initialize do
end
Discourse::Application.routes.prepend do
mount ::DiscoursePayments::Engine, at: '/'
mount ::DiscourseDonations::Engine, at: '/'
end

View File

@ -1,8 +1,8 @@
require 'rails_helper'
module DiscoursePayments
module DiscourseDonations
RSpec.describe ChargesController, type: :controller do
routes { DiscoursePayments::Engine.routes }
routes { DiscourseDonations::Engine.routes }
#
it 'responds with ok' do
skip 'need to get fixtures'

View File

@ -1,7 +1,7 @@
require 'rails_helper'
module DiscoursePayments
module DiscourseDonations
RSpec.describe PaymentsController, type: :controller do
routes { DiscoursePayments::Engine.routes }
routes { DiscourseDonations::Engine.routes }
end
end