Skip to content

Commit

Permalink
Dropped redundant 'location' column
Browse files Browse the repository at this point in the history
Looks like I messed up later on and kept two columns which were
basically referring to the same thing.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Mar 14, 2024
1 parent c232356 commit 8818aa6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/controllers/things_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def set_thing

def thing_params
params.require(:thing).permit(:target, :title, :publisher, :address, :year, :url, :access,
:authors, :location, :insideof, :pages, :rate, :status, :kind,
:bought_at, :editors, :note, :where_is_it, tag_ids: [])
:authors, :insideof, :pages, :rate, :status, :kind, :bought_at,
:editors, :note, :where_is_it, tag_ids: [])
end
end
1 change: 0 additions & 1 deletion app/models/thing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def self.like(text:)
.or(where('publisher LIKE ?', "%#{text}%"))
.or(where('address LIKE ?', "%#{text}%"))
.or(where('url LIKE ?', "%#{text}%"))
.or(where('location LIKE ?', "%#{text}%"))
.or(where('insideof LIKE ?', "%#{text}%"))
.or(where('pages LIKE ?', "%#{text}%"))
.or(where('note LIKE ?', "%#{text}%"))
Expand Down
5 changes: 0 additions & 5 deletions app/views/things/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
<%= form.date_field :access %>
</div>

<div>
<%= form.label :location %>
<%= form.text_field :location %>
</div>

<div>
<%= form.label :insideof %>
<%= form.text_field :insideof %>
Expand Down
1 change: 0 additions & 1 deletion config/locales/ca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ca:
year: Any
url: Enllaç
access: Última data de consulta
location: Lloc
insideof: Dins de
pages: Pàgines
rate: Qualificació
Expand Down
1 change: 0 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ en:
year: Year
url: URL
access: Last consulted at
location: Place
insideof: Inside of
pages: Pages
rate: Rate
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240314211609_drop_location_column.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class DropLocationColumn < ActiveRecord::Migration[7.1]
def change
remove_column :things, :location
end
end
3 changes: 1 addition & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions test/fixtures/things.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ thing1:
address:
year: 2024
url: 'http://example.com'
location: 'Somewhere'
insideof: 'Some other thing'
pages: '22-24'
note: 'This is a note 1'
Expand All @@ -27,7 +26,6 @@ thing2:
address: 'Address 2'
year: 2024
url: 'http://example.com'
location: 'Somewhere'
insideof: 'Some other thing'
pages: '22-24'
note: 'This is a note 2'
Expand Down

0 comments on commit 8818aa6

Please sign in to comment.