Skip to content

Commit

Permalink
rename addreses
Browse files Browse the repository at this point in the history
  • Loading branch information
qinmingyuan committed Nov 26, 2023
1 parent 26a12fb commit 6e4224e
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ GIT

GIT
remote: https://github.com/work-design/rails_com.git
revision: afa5675bce5c18839bd28fd01ea29d57ab4d537d
revision: 6c95fbd26d878a8b46716c47195712ac50b31d24
specs:
rails_com (1.3.0)
acme-client
Expand All @@ -27,14 +27,14 @@ GIT

GIT
remote: https://github.com/work-design/rails_design.git
revision: 3f94091e92a96c4ee1589cab0718aa349bf7463d
revision: a3df6fa70568e85060db2176456583074597460f
specs:
rails_design (0.0.1)
rails

GIT
remote: https://github.com/work-design/rails_extend.git
revision: 9f040fe7020cdddb300256f6cb74b98ae55c0a86
revision: 075daf9b8da63a99cfcea45f91eb51e2cf3276b2
specs:
rails_extend (1.0.1)
rails (>= 5.0)
Expand Down Expand Up @@ -160,7 +160,7 @@ GEM
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
good_job (3.21.1)
good_job (3.21.2)
activejob (>= 6.0.0)
activerecord (>= 6.0.0)
concurrent-ruby (>= 1.0.2)
Expand All @@ -169,7 +169,7 @@ GEM
thor (>= 0.14.1)
http-2-next (1.0.1)
http-form_data (2.3.0)
httpx (1.1.4)
httpx (1.1.5)
http-2-next (>= 1.0.1)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -339,10 +339,10 @@ CHECKSUMS
faraday-retry (2.2.0) sha256=80824a5454dd0ce7d8074013454d163569b909001a64bdb3499c9968df4f41c5
fugit (1.9.0) sha256=e92ae18828a094afdd753e42ded0b83ad3449d79adddc5d1ab88e28dbfedd221
globalid (1.2.1) sha256=70bf76711871f843dbba72beb8613229a49429d1866828476f9c9d6ccc327ce9
good_job (3.21.1) sha256=2a2bccb6f80461a24772e26023b86b542cf8f4e994e6a6557ad1b76a025bbd97
good_job (3.21.2)
http-2-next (1.0.1) sha256=255a0c0f0d35e8b5352d3bc5b2bdb3643a27a65e0da7f10a7f2f75e1c23ae640
http-form_data (2.3.0) sha256=cc4eeb1361d9876821e31d7b1cf0b68f1cf874b201d27903480479d86448a5f3
httpx (1.1.4)
httpx (1.1.5)
i18n (1.14.1) sha256=9d03698903547c060928e70a9bc8b6b87fda674453cda918fc7ab80235ae4a61
io-console (0.6.0) sha256=ce9d9a3455be48c56cac65b8ef7ec59b07526343905f9fda138791005b563336
irb (1.9.0) sha256=bb7c14302574c8c03c81ba6630878dfea7aa7238e666a67ccfa445c34a624214
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/profiled/admin/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def address_permit_params
[
:kind,
:name,
:contact,
:contact_person,
:tel,
:detail,
:area_id,
Expand Down
6 changes: 3 additions & 3 deletions app/models/profiled/model/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Model::Address
included do
attribute :name, :string
attribute :detail, :string
attribute :contact, :string
attribute :contact_person, :string
attribute :tel, :string
attribute :post_code, :string
attribute :source, :string
Expand All @@ -29,15 +29,15 @@ module Model::Address
end

def sync_cached_key
self.cached_key = [area_id, detail, contact, tel].join(',')
self.cached_key = [area_id, detail, contact_person, tel].join(',')
end

def content
"#{area.full_name} #{detail}"
end

def contact_info
"#{contact} #{tel}"
"#{contact_person} #{tel}"
end

def set_principal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<td>
<p><%= model.contact %></p>
<p><%= model.contact_person %></p>
<p><%= model.tel %></p>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<th>
<p><%= Profiled::Address.human_attribute_name(:contact) %></p>
<p><%= Profiled::Address.human_attribute_name(:contact_person) %></p>
<p><%= Profiled::Address.human_attribute_name(:tel) %></p>
</th>
<th>
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiled/admin/addresses/_form.html+phone.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= f.text_field :contact %>
<%= f.text_field :contact_person %>
<%= f.text_field :tel %>
<div
class="weui-cell weui-cell_active weui-cell_readonly"
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiled/admin/addresses/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= f.text_field :contact, autocomplete: 'off' %>
<%= f.text_field :contact_person, autocomplete: 'off' %>
<%= f.text_field :tel, autocomplete: 'off' %>
<%= render partial: 'com/nodes/outer_select', locals: { f: f, outer: 'area', node: f.object.area } %>
<%= f.text_field :detail, autocomplete: 'off' %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/profiled/admin/addresses/_show_table.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<tr>
<td class="has-text-right"><%= Profiled::Address.human_attribute_name(:contact) %></td>
<td><%= @address.contact %></td>
<td class="has-text-right"><%= Profiled::Address.human_attribute_name(:contact_person) %></td>
<td><%= @address.contact_person %></td>
</tr>
<tr>
<td class="has-text-right"><%= Profiled::Address.human_attribute_name(:tel) %></td>
Expand Down

0 comments on commit 6e4224e

Please sign in to comment.