Skip to content

Commit

Permalink
Fix rubocop offenses and remove duplicated index from roles
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Dec 20, 2024
1 parent 30861c1 commit e3f06b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
7 changes: 7 additions & 0 deletions db/migrate/010_remove_duplicated_index_from_roles.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class RemoveDuplicatedIndexFromRoles < ActiveRecord::Migration[7.2]
def change
remove_index :dashboard_roles, name: 'index_dashboard_roles_on_dashboard_id', column: :dashboard_id
end
end
28 changes: 14 additions & 14 deletions lib/additionals/wiki_macros/meteoblue_macro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,28 @@ module MeteoblueMacro
src << "?geoloc=fixed&days=#{options[:days]}&tempunit=CELSIUS&windunit=KILOMETER_PER_HOUR"
src << "&precipunit=MILLIMETER&coloured=#{options[:coloured]}"

src << Additionals.meteoblue_flag(options, :pictoicon, true)
src << Additionals.meteoblue_flag(options, :maxtemperature, true)
src << Additionals.meteoblue_flag(options, :mintemperature, true)
src << Additionals.meteoblue_flag(options, :windspeed, false)
src << Additionals.meteoblue_flag(options, :windgust, false)
src << Additionals.meteoblue_flag(options, :winddirection, false)
src << Additionals.meteoblue_flag(options, :uv, false)
src << Additionals.meteoblue_flag(options, :humidity, false)
src << Additionals.meteoblue_flag(options, :precipitation, true)
src << Additionals.meteoblue_flag(options, :precipitationprobability, true)
src << Additionals.meteoblue_flag(options, :spot, true)
src << Additionals.meteoblue_flag(options, :pressure, false)
src << Additionals.meteoblue_flag(options, :pictoicon, default: true)
src << Additionals.meteoblue_flag(options, :maxtemperature, default: true)
src << Additionals.meteoblue_flag(options, :mintemperature, default: true)
src << Additionals.meteoblue_flag(options, :windspeed)
src << Additionals.meteoblue_flag(options, :windgust)
src << Additionals.meteoblue_flag(options, :winddirection)
src << Additionals.meteoblue_flag(options, :uv)
src << Additionals.meteoblue_flag(options, :humidity)
src << Additionals.meteoblue_flag(options, :precipitation, default: true)
src << Additionals.meteoblue_flag(options, :precipitationprobability, default: true)
src << Additionals.meteoblue_flag(options, :spot, default: true)
src << Additionals.meteoblue_flag(options, :pressure)

tag.iframe width:, height:, src:, frameborder: 0
end
end
end
end

def self.meteoblue_flag(options, name, default = true)
def self.meteoblue_flag(options, name, default: false)
flag = "&#{name}="
flag << if RedminePluginKit.true? options[name] || default
flag << if RedminePluginKit.true?(options[name]) || default
'1'
else
'0'
Expand Down

0 comments on commit e3f06b1

Please sign in to comment.