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)
|
||||
|
||||
decoded_response[:scope].gsub(/post/, "create").split.map(&:to_sym)
|
||||
decoded_response[:scope].gsub("post", "create").split.map(&:to_sym)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -36,8 +36,6 @@ module Adamantium
|
||||
code = url.scan(pattern).flatten.first
|
||||
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>"
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -33,7 +33,7 @@ module Adamantium
|
||||
end
|
||||
ENV["TZ"] = nil
|
||||
|
||||
top_track_repo.for_post(id: post.id)
|
||||
top_track_repo.for_post(id: post.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@@ -23,13 +23,13 @@ module Adamantium
|
||||
end
|
||||
|
||||
def weekly
|
||||
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
|
||||
where(:id => ref)
|
||||
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
|
||||
where(id: ref)
|
||||
end
|
||||
|
||||
def non_weekly
|
||||
ref = post_tags.where(:tag_id => "70").select(:post_id).dataset
|
||||
exclude(:id => ref)
|
||||
ref = post_tags.where(tag_id: "70").select(:post_id).dataset
|
||||
exclude(id: ref)
|
||||
end
|
||||
|
||||
def published_between(start_date, end_date)
|
||||
|
@@ -17,3 +17,4 @@ if [ -n "$1" ]; then
|
||||
else
|
||||
bundle exec rake spec
|
||||
fi
|
||||
|
||||
|
@@ -8,9 +8,8 @@ module Admin
|
||||
|
||||
def handle(req, res)
|
||||
add_syndication_source.call(post_id: req.params[:id],
|
||||
source_name: req.params[:syndication_source_name],
|
||||
source_url: req.params[:syndication_source_url]
|
||||
)
|
||||
source_name: req.params[:syndication_source_name],
|
||||
source_url: req.params[:syndication_source_url])
|
||||
|
||||
res.status = 201
|
||||
res.headers["HX-Refresh"] = true
|
||||
|
@@ -5,7 +5,7 @@ module Admin
|
||||
include Deps["commands.posts.update"]
|
||||
|
||||
def handle(req, res)
|
||||
update.(params: req.params)
|
||||
update.call(params: req.params)
|
||||
res.redirect "/admin/posts/#{req.params[:id]}"
|
||||
end
|
||||
end
|
||||
|
@@ -3,8 +3,8 @@ module Admin
|
||||
module Posts
|
||||
class Update
|
||||
include Deps[
|
||||
"repos.post_repo",
|
||||
"renderers.markdown"
|
||||
"repos.post_repo",
|
||||
"renderers.markdown"
|
||||
]
|
||||
|
||||
def call(params:)
|
||||
|
@@ -7,7 +7,7 @@ module Admin
|
||||
|
||||
expose :photos_buckets do |available_paths|
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user