Skip to content

Commit

Permalink
Fix typo in user_format: s/coma/comma/
Browse files Browse the repository at this point in the history
  • Loading branch information
myabc committed Jan 8, 2025
1 parent df381fd commit b4c51d6
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/models/concerns/reactable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def user_name_concat_format_sql
"users.firstname"
when :lastname_firstname
"concat_ws(' ', users.lastname, users.firstname)"
when :lastname_coma_firstname
when :lastname_comma_firstname
"concat_ws(', ', users.lastname, users.firstname)"
when :lastname_n_firstname
"concat_ws('', users.lastname, users.firstname)"
Expand Down
2 changes: 1 addition & 1 deletion app/models/principals/scopes/ordered_by_name.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def user_concat_sql
"concat_ws(' ', users.firstname, users.lastname)"
when :firstname
"users.firstname"
when :lastname_firstname, :lastname_coma_firstname, :lastname_n_firstname
when :lastname_firstname, :lastname_comma_firstname, :lastname_n_firstname
"concat_ws(' ', users.lastname, users.firstname)"
when :username
"users.login"
Expand Down
2 changes: 1 addition & 1 deletion app/models/queries/filters/shared/user_name_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def sql_concat_name
"LOWER(CONCAT(users.firstname, ' ', users.lastname))"
when :firstname
"LOWER(users.firstname)"
when :lastname_firstname, :lastname_coma_firstname
when :lastname_firstname, :lastname_comma_firstname
"LOWER(CONCAT(users.lastname, CONCAT(' ', users.firstname)))"
when :lastname_n_firstname
"LOWER(CONCAT(users.lastname, users.firstname))"
Expand Down
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class User < Principal
firstname: [:firstname],
lastname_firstname: %i[lastname firstname],
lastname_n_firstname: %i[lastname firstname],
lastname_coma_firstname: %i[lastname firstname],
lastname_comma_firstname: %i[lastname firstname],
username: [:login]
}.freeze

Expand Down Expand Up @@ -295,7 +295,7 @@ def name(formatter = nil)
when :firstname_lastname then "#{firstname} #{lastname}"
when :lastname_firstname then "#{lastname} #{firstname}"
when :lastname_n_firstname then "#{lastname}#{firstname}"
when :lastname_coma_firstname then "#{lastname}, #{firstname}"
when :lastname_comma_firstname then "#{lastname}, #{firstname}"
when :firstname then firstname
when :username then login

Expand Down
2 changes: 1 addition & 1 deletion lib/api/decorators/sql/hal_associated_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def associated_user_link_href(table_name, column_name)

def associated_user_link_title(table_name)
-> {
join_string = if Setting.user_format == :lastname_coma_firstname
join_string = if Setting.user_format == :lastname_comma_firstname
" || ', ' || "
else
" || ' ' || "
Expand Down
2 changes: 1 addition & 1 deletion lib/api/v3/users/user_sql_representer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def user_name_projection(*)
"firstname"
when :lastname_firstname
"concat(lastname, ' ', firstname)"
when :lastname_coma_firstname
when :lastname_comma_firstname
"concat(lastname, ', ', firstname)"
when :lastname_n_firstname
"concat_ws(lastname, '', firstname)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
it_behaves_like "name property depending on user format setting"
end

context "when user_format is set to lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
context "when user_format is set to lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "name property depending on user format setting"
end

Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/user_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
# and last name whereby an unescaped comma will lead to have two email addresses
# defined instead of one (['Bobbi', '[email protected]'] vs. ['[email protected]'])
context "with the user name setting prone to trip up email address separation",
with_settings: { user_format: :lastname_coma_firstname } do
with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "mail is sent"
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/concerns/reactable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
end
end

context "when user format is set to :lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
context "when user format is set to :lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it "returns grouped emoji reactions with last coma firstname" do
result = Journal.grouped_emoji_reactions(reactable_id: wp_journal1.id, reactable_type: "Journal")

Expand Down
2 changes: 1 addition & 1 deletion spec/models/principal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def self.should_return_groups_and_users_if_active(method, *)
shared_let(:placeholder_user_id) { create(:placeholder_user, name: "Wannabejohn").id }

shared_examples "name formatting" do
context "for lastname_coma_firstname formatter", with_settings: { user_format: :lastname_coma_firstname } do
context "for lastname_comma_firstname formatter", with_settings: { user_format: :lastname_comma_firstname } do
it "returns formatted user name" do
expect(user.name).to eq "Smith, John"
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/principals/scopes/ordered_by_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
end
end

context "with lastname_coma_firstname user sort", with_settings: { user_format: :lastname_coma_firstname } do
context "with lastname_comma_firstname user sort", with_settings: { user_format: :lastname_comma_firstname } do
it_behaves_like "sorted results" do
let(:order) { [anonymous.id, eve.id, group.id, placeholder_user.id, alice.id] }
end
Expand Down
6 changes: 3 additions & 3 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
it { is_expected.to eq "SmithJohn" }
end

context "for lastname_coma_firstname", with_settings: { user_format: :lastname_coma_firstname } do
context "for lastname_comma_firstname", with_settings: { user_format: :lastname_comma_firstname } do
it { is_expected.to eq "Smith, John" }
end

Expand All @@ -350,8 +350,8 @@

let(:user) { described_class.select_for_name(formatter).last }

context "for lastname_coma_firstname" do
let(:formatter) { :lastname_coma_firstname }
context "for lastname_comma_firstname" do
let(:formatter) { :lastname_comma_firstname }

it { is_expected.to eq "Smith, John" }
end
Expand Down

0 comments on commit b4c51d6

Please sign in to comment.