Standard rb fixes
This commit is contained in:
@@ -82,7 +82,7 @@ module Adamantium
|
|||||||
|
|
||||||
halt 401 unless (decoded_response.include? :scope) && (decoded_response.include? :me)
|
halt 401 unless (decoded_response.include? :scope) && (decoded_response.include? :me)
|
||||||
|
|
||||||
decoded_response[:scope].gsub(/post/, "create").split.map(&:to_sym)
|
decoded_response[:scope].gsub("post", "create").split.map(&:to_sym)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -36,8 +36,6 @@ module Adamantium
|
|||||||
code = url.scan(pattern).flatten.first
|
code = url.scan(pattern).flatten.first
|
||||||
if code
|
if code
|
||||||
"<div class='video-container'><iframe width='100%' src='https://www.youtube.com/embed/#{code}' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' allowfullscreen></iframe></div>"
|
"<div class='video-container'><iframe width='100%' src='https://www.youtube.com/embed/#{code}' title='YouTube video player' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share' allowfullscreen></iframe></div>"
|
||||||
else
|
|
||||||
nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -33,7 +33,7 @@ module Adamantium
|
|||||||
end
|
end
|
||||||
ENV["TZ"] = nil
|
ENV["TZ"] = nil
|
||||||
|
|
||||||
top_track_repo.for_post(id: post.id)
|
top_track_repo.for_post(id: post.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -23,13 +23,13 @@ module Adamantium
|
|||||||
end
|
end
|
||||||
|
|
||||||
def weekly
|
def weekly
|
||||||
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
|
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
|
||||||
where(:id => ref)
|
where(id: ref)
|
||||||
end
|
end
|
||||||
|
|
||||||
def non_weekly
|
def non_weekly
|
||||||
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
|
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
|
||||||
exclude(:id => ref)
|
exclude(id: ref)
|
||||||
end
|
end
|
||||||
|
|
||||||
def published_between(start_date, end_date)
|
def published_between(start_date, end_date)
|
||||||
|
@@ -17,3 +17,4 @@ if [ -n "$1" ]; then
|
|||||||
else
|
else
|
||||||
bundle exec rake spec
|
bundle exec rake spec
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -8,9 +8,8 @@ module Admin
|
|||||||
|
|
||||||
def handle(req, res)
|
def handle(req, res)
|
||||||
add_syndication_source.call(post_id: req.params[:id],
|
add_syndication_source.call(post_id: req.params[:id],
|
||||||
source_name: req.params[:syndication_source_name],
|
source_name: req.params[:syndication_source_name],
|
||||||
source_url: req.params[:syndication_source_url]
|
source_url: req.params[:syndication_source_url])
|
||||||
)
|
|
||||||
|
|
||||||
res.status = 201
|
res.status = 201
|
||||||
res.headers["HX-Refresh"] = true
|
res.headers["HX-Refresh"] = true
|
||||||
|
@@ -5,7 +5,7 @@ module Admin
|
|||||||
include Deps["commands.posts.update"]
|
include Deps["commands.posts.update"]
|
||||||
|
|
||||||
def handle(req, res)
|
def handle(req, res)
|
||||||
update.(params: req.params)
|
update.call(params: req.params)
|
||||||
res.redirect "/admin/posts/#{req.params[:id]}"
|
res.redirect "/admin/posts/#{req.params[:id]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -3,8 +3,8 @@ module Admin
|
|||||||
module Posts
|
module Posts
|
||||||
class Update
|
class Update
|
||||||
include Deps[
|
include Deps[
|
||||||
"repos.post_repo",
|
"repos.post_repo",
|
||||||
"renderers.markdown"
|
"renderers.markdown"
|
||||||
]
|
]
|
||||||
|
|
||||||
def call(params:)
|
def call(params:)
|
||||||
|
@@ -7,7 +7,7 @@ module Admin
|
|||||||
|
|
||||||
expose :photos_buckets do |available_paths|
|
expose :photos_buckets do |available_paths|
|
||||||
available_paths.each_with_object({}) do |root, memo|
|
available_paths.each_with_object({}) do |root, memo|
|
||||||
memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"].sort {|a,b| File.ctime(b) <=> File.ctime(a) }
|
memo[root.gsub(MEDIA_DIR, "")] = Dir["#{root}/**"].sort { |a, b| File.ctime(b) <=> File.ctime(a) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user