Skip to content

Commit 8d593c4

Browse files
committed
feat(translations): update name translations to use string type for consistency and performance
1 parent e656a98 commit 8d593c4

File tree

11 files changed

+300
-10
lines changed

11 files changed

+300
-10
lines changed

app/models/better_together/calendar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Calendar < ApplicationRecord
1717

1818
slugged :name
1919

20-
translates :name
20+
translates :name, type: :string
2121
translates :description, backend: :action_text
2222

2323
def to_s

app/models/better_together/call_for_interest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CallForInterest < ApplicationRecord
99
include Identifier
1010
include Privacy
1111

12-
translates :name
12+
translates :name, type: :string
1313
translates :description, backend: :action_text
1414

1515
slugged :name

app/models/better_together/event.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Event < ApplicationRecord
3636
# delegate :geocoding_string, to: :address, allow_nil: true
3737
# geocoded_by :geocoding_string
3838

39-
translates :name
39+
translates :name, type: :string
4040
translates :description, backend: :action_text
4141

4242
slugged :name

app/models/better_together/infrastructure/building.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Building < ApplicationRecord
4242
after_create :schedule_address_geocoding
4343
after_update :schedule_address_geocoding
4444

45-
translates :name
45+
translates :name, type: :string
4646
translates :description, backend: :action_text
4747

4848
slugged :name

app/models/better_together/infrastructure/floor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Floor < ApplicationRecord
2020
belongs_to :building, class_name: 'BetterTogether::Infrastructure::Building', touch: true
2121
has_many :rooms, class_name: 'BetterTogether::Infrastructure::Room', dependent: :destroy
2222

23-
translates :name
23+
translates :name, type: :string
2424
translates :description, backend: :action_text
2525

2626
slugged :name

app/models/better_together/infrastructure/room.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Room < ApplicationRecord
1919

2020
delegate :level, to: :floor
2121

22-
translates :name
22+
translates :name, type: :string
2323
translates :description, backend: :action_text
2424

2525
slugged :name

app/models/better_together/role.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Role < ApplicationRecord
1313

1414
slugged :identifier, dependent: :delete_all
1515

16-
translates :name
16+
translates :name, type: :string
1717
translates :description, type: :text
1818

1919
validates :name,

app/models/better_together/upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Upload < ApplicationRecord
1212

1313
delegate :attached?, :byte_size, :content_type, :download, :filename, :url, to: :file
1414

15-
translates :name
15+
translates :name, type: :string
1616
translates :description, backend: :action_text
1717

1818
include RemoveableAttachment

app/models/better_together/wizard.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Wizard < ApplicationRecord
1212

1313
slugged :identifier, dependent: :delete_all
1414

15-
translates :name
15+
translates :name, type: :string
1616
translates :description, type: :text
1717

1818
validates :name, presence: true

app/models/better_together/wizard_step_definition.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class WizardStepDefinition < ApplicationRecord
1414

1515
slugged :identifier, dependent: :delete_all
1616

17-
translates :name
17+
translates :name, type: :string
1818
translates :description, type: :text
1919

2020
validates :name, presence: true

0 commit comments

Comments
 (0)