mirror of
https://github.com/discourse/discourse.git
synced 2025-02-28 08:19:13 +00:00
DEV: Instantiate relation early to save a query (#14766)
Previously it would do `SELECT 1 AS one` and then `SELECT "color_scheme_colors".*`. Now it only does the latter.
This commit is contained in:
parent
b1603c8667
commit
19c9b892dc
@ -346,7 +346,7 @@ class ColorScheme < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def is_dark?
|
||||
return if colors.empty?
|
||||
return if colors.to_a.empty?
|
||||
|
||||
primary_b = brightness(colors_by_name["primary"].hex)
|
||||
secondary_b = brightness(colors_by_name["secondary"].hex)
|
||||
|
Loading…
x
Reference in New Issue
Block a user