Skip to content

Commit

Permalink
DEV: Instantiate relation early to save a query (#14766)
Browse files Browse the repository at this point in the history
Previously it would do `SELECT 1 AS one` and then `SELECT "color_scheme_colors".*`. Now it only does the latter.
  • Loading branch information
CvX committed Oct 29, 2021
1 parent b1603c8 commit 19c9b89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/color_scheme.rb
Expand Up @@ -346,7 +346,7 @@ def bump_version
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)
Expand Down

0 comments on commit 19c9b89

Please sign in to comment.