Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Commit a19fe45

Browse files
Shpigfordclaude
andcommitted
Apply RuboCop linting fixes
- Fixed spacing inside array brackets - Converted old hash syntax to new Ruby 1.9 syntax - Removed trailing whitespace - Fixed string quote consistency - Added missing final newlines - Applied all RuboCop auto-corrections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 14a6256 commit a19fe45

18 files changed

+52
-52
lines changed

app/avo/resources/article.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def fields
1414
field :slug, as: :text
1515
field :content, as: :easy_mde
1616
field :publish_at, as: :date_time
17-
field :author_name, as: :text, hide_on: [:forms]
18-
17+
field :author_name, as: :text, hide_on: [ :forms ]
18+
1919
tabs do
2020
tab "Author" do
2121
field :authorship, as: :has_one

app/avo/resources/author.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def fields
1616
field :avatar_url, as: :text
1717
field :position, as: :text
1818
field :email, as: :text
19-
field :social_links, as: :code, language: 'javascript'
20-
19+
field :social_links, as: :code, language: "javascript"
20+
2121
tabs do
2222
tab "Content" do
2323
field :articles, as: :has_many
@@ -26,4 +26,4 @@ def fields
2626
end
2727
end
2828
end
29-
end
29+
end

app/avo/resources/authorship.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
class Avo::Resources::Authorship < Avo::BaseResource
2-
self.includes = [:author, :authorable]
3-
2+
self.includes = [ :author, :authorable ]
3+
44
def fields
55
field :id, as: :id
66
field :author, as: :belongs_to, searchable: true
7-
field :authorable, as: :belongs_to, polymorphic_as: :authorable,
8-
types: [::Article, ::Term, ::Faq]
7+
field :authorable, as: :belongs_to, polymorphic_as: :authorable,
8+
types: [ ::Article, ::Term, ::Faq ]
99
field :role, as: :select, options: {
1010
primary: "Primary",
11-
contributor: "Contributor",
11+
contributor: "Contributor",
1212
editor: "Editor",
1313
reviewer: "Reviewer"
1414
}, default: "primary"
1515
field :position, as: :number, default: 0
1616
end
17-
end
17+
end

app/avo/resources/faq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def fields
1414
field :answer, as: :easy_mde
1515
field :slug, as: :text
1616
field :category, as: :select, options: Faq::CATEGORIES
17-
17+
1818
tabs do
1919
tab "Author" do
2020
field :authorship, as: :has_one

app/avo/resources/term.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def fields
1818
field :video_description, as: :textarea
1919
field :video_upload_date, as: :date
2020
field :video_duration, as: :text
21-
21+
2222
tabs do
2323
tab "Author" do
2424
field :authorship, as: :has_one

app/controllers/articles_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ class ArticlesController < ApplicationController
1010
# @example
1111
# GET /articles
1212
def index
13-
@featured_article = Article.published.latest.includes(:authorship => :author).first
13+
@featured_article = Article.published.latest.includes(authorship: :author).first
1414
@pagy, @articles = pagy(
1515
Article.published
1616
.where.not(id: @featured_article&.id)
1717
.latest
18-
.includes(:authorship => :author),
18+
.includes(authorship: :author),
1919
items: 6,
2020
limit: 6
2121
)
@@ -29,7 +29,7 @@ def index
2929
# @example
3030
# GET /articles/my-first-article
3131
def show
32-
@article = Article.includes(:authorship => :author).find_by(slug: params[:id])
32+
@article = Article.includes(authorship: :author).find_by(slug: params[:id])
3333
redirect_to articles_path unless @article
3434
end
3535
end
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
class AuthorsController < ApplicationController
2-
before_action :set_author, only: [:show]
3-
2+
before_action :set_author, only: [ :show ]
3+
44
def index
55
@authors = Author.includes(:authorships).order(:name)
66
end
7-
7+
88
def show
9-
@articles = @author.articles.published.latest.includes(:authorship => :author)
10-
@terms = @author.terms.includes(:authorship => :author)
11-
@faqs = @author.faqs.includes(:authorship => :author)
12-
9+
@articles = @author.articles.published.latest.includes(authorship: :author)
10+
@terms = @author.terms.includes(authorship: :author)
11+
@faqs = @author.faqs.includes(authorship: :author)
12+
1313
@content_count = @articles.count + @terms.count + @faqs.count
1414
end
15-
15+
1616
private
17-
17+
1818
def set_author
1919
@author = Author.find_by!(slug: params[:slug])
2020
end
21-
end
21+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class Avo::AuthorsController < Avo::ResourcesController
2-
end
2+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
class Avo::AuthorshipsController < Avo::ResourcesController
2-
end
2+
end

app/controllers/faqs_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def index
4141
# @example
4242
# GET /faqs/what-is-compound-interest
4343
def show
44-
@faq = Faq.includes(:authorship => :author).find_by(slug: params[:id])
44+
@faq = Faq.includes(authorship: :author).find_by(slug: params[:id])
4545

4646
unless @faq
4747
redirect_to faqs_path, alert: "FAQ not found"

0 commit comments

Comments
 (0)