Skip to content

Commit

Permalink
Appease Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jun 1, 2020
1 parent ce24df0 commit 50b60f1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/models/alchemy/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ module Alchemy
class Node < BaseRecord
VALID_URL_REGEX = /\A(\/|\D[a-z\+\d\.\-]+:)/

acts_as_nested_set scope: 'language_id', touch: true
acts_as_nested_set scope: "language_id", touch: true
stampable stamper_class_name: Alchemy.user_class_name

belongs_to :site, class_name: 'Alchemy::Site'
belongs_to :language, class_name: 'Alchemy::Language'
belongs_to :page, class_name: 'Alchemy::Page', optional: true, inverse_of: :nodes
belongs_to :site, class_name: "Alchemy::Site"
belongs_to :language, class_name: "Alchemy::Language"
belongs_to :page, class_name: "Alchemy::Page", optional: true, inverse_of: :nodes

validates :name, presence: true, if: -> { page.nil? }
validates :url, format: { with: VALID_URL_REGEX }, unless: -> { url.nil? }
Expand All @@ -25,7 +25,8 @@ def name
class << self
# Returns all root nodes for current language
def language_root_nodes
raise 'No language found' if Language.current.nil?
raise "No language found" if Language.current.nil?

roots.where(language_id: Language.current.id)
end

Expand All @@ -48,7 +49,7 @@ def read_definitions_file
# Returns the +menus.yml+ file path
#
def definitions_file_path
Rails.root.join 'config/alchemy/menus.yml'
Rails.root.join "config/alchemy/menus.yml"
end
end

Expand Down

0 comments on commit 50b60f1

Please sign in to comment.