DEV: Apply syntax_tree formatting to app/*

This commit is contained in:
David Taylor
2023-01-09 12:20:10 +00:00
parent a641ce4b62
commit 5a003715d3
696 changed files with 18447 additions and 15481 deletions

View File

@@ -31,7 +31,7 @@ class PluginStore
end
def self.get_all(plugin_name, keys)
rows = PluginStoreRow.where('plugin_name = ? AND key IN (?)', plugin_name, keys).to_a
rows = PluginStoreRow.where("plugin_name = ? AND key IN (?)", plugin_name, keys).to_a
Hash[rows.map { |row| [row.key, cast_value(row.type_name, row.value)] }]
end
@@ -72,10 +72,14 @@ class PluginStore
def self.cast_value(type, value)
case type
when "Integer", "Fixnum" then value.to_i
when "TrueClass", "FalseClass" then value == "true"
when "JSON" then map_json(::JSON.parse(value))
else value
when "Integer", "Fixnum"
value.to_i
when "TrueClass", "FalseClass"
value == "true"
when "JSON"
map_json(::JSON.parse(value))
else
value
end
end
end