Add admin area
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
module Adamantium
|
||||
module Middleware
|
||||
class BasicAuth < Rack::Auth::Basic
|
||||
def call(env)
|
||||
request = Rack::Request.new(env)
|
||||
if request.path.match(/^\/admin*/)
|
||||
# Execute basic authentication
|
||||
super(env)
|
||||
else
|
||||
# Pass basic authentication
|
||||
@app.call(env)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -6,8 +6,8 @@ module Adamantium
|
||||
class Tags < ROM::Relation[:sql]
|
||||
schema :tags, infer: true do
|
||||
associations do
|
||||
belongs_to :post_tag
|
||||
belongs_to :post, through: :post_tag
|
||||
has_many :post_tags
|
||||
has_many :posts, through: :post_tags
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user