Skip to content

Commit

Permalink
Merge pull request #3176 from fjordllc/feature/remove_features_of_books
Browse files Browse the repository at this point in the history
書籍貸出に関する機能の削除
  • Loading branch information
machida authored Sep 6, 2021
2 parents 20929c1 + 7644314 commit 2cefbf6
Show file tree
Hide file tree
Showing 48 changed files with 21 additions and 743 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gem 'rails_autolink'
gem 'rails-i18n'
gem 'ransack'
gem 'rollbar'
gem 'rqrcode'
gem 'slim-rails'
gem 'sorcery'
gem 'sorcery-jwt'
Expand Down
6 changes: 0 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (3.0.0)
chunky_png (1.4.0)
cocoon (1.2.15)
coderay (1.1.3)
coffee-rails (5.0.0)
Expand Down Expand Up @@ -345,10 +344,6 @@ GEM
retriable (3.1.2)
rexml (3.2.5)
rollbar (3.1.1)
rqrcode (1.2.0)
chunky_png (~> 1.0)
rqrcode_core (~> 0.2)
rqrcode_core (0.2.0)
rubocop (1.18.3)
parallel (~> 1.10)
parser (>= 3.0.0.0)
Expand Down Expand Up @@ -531,7 +526,6 @@ DEPENDENCIES
rails_autolink
ransack
rollbar
rqrcode
rubocop
rubocop-fjord
rubocop-minitest
Expand Down
1 change: 0 additions & 1 deletion app/assets/images/pijord-book-logo.svg

This file was deleted.

67 changes: 0 additions & 67 deletions app/assets/stylesheets/qrcodes.sass

This file was deleted.

14 changes: 0 additions & 14 deletions app/controllers/admin/books/qrcodes_controller.rb

This file was deleted.

54 changes: 0 additions & 54 deletions app/controllers/admin/books_controller.rb

This file was deleted.

7 changes: 0 additions & 7 deletions app/controllers/books/borrowed_controller.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/controllers/books/search_results_controller.rb

This file was deleted.

13 changes: 0 additions & 13 deletions app/controllers/books_controller.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/controllers/borrowings_controller.rb

This file was deleted.

16 changes: 0 additions & 16 deletions app/decorators/book_decorator.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/models/book.rb

This file was deleted.

6 changes: 0 additions & 6 deletions app/models/borrowing.rb

This file was deleted.

18 changes: 0 additions & 18 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class User < ApplicationRecord
belongs_to :company, optional: true
belongs_to :course
has_many :learnings, dependent: :destroy
has_many :borrowings, dependent: :destroy
has_many :pages, dependent: :destroy
has_many :comments, dependent: :destroy
has_many :reports, dependent: :destroy
Expand Down Expand Up @@ -97,9 +96,6 @@ class User < ApplicationRecord
source: :practice,
dependent: :destroy

has_many :books,
through: :borrowings

has_many :active_relationships,
class_name: 'Following',
foreign_key: 'follower_id',
Expand Down Expand Up @@ -479,20 +475,6 @@ def unread_notifications_exists?
unread_notifications_count.positive?
end

def borrow(book)
book.update(borrowed: true)
borrowings.create(book_id: book.id)
end

def give_back(book)
book.update(borrowed: false)
borrowings.find_by(book_id: book.id).destroy
end

def borrowing?(book)
borrowings.exists?(book_id: book.id)
end

def avatar_url
default_image_path = '/images/users/avatars/default.png'
if avatar.attached?
Expand Down
4 changes: 0 additions & 4 deletions app/views/admin/_admin_page_tabs.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
= link_to '企業',
admin_companies_path,
class: "page-tabs__item-link #{current_link(/^admin-companies/)}"
li.page-tabs__item
= link_to '書籍',
admin_books_path,
class: "page-tabs__item-link #{current_link(/^admin-books/)}"
li.page-tabs__item
= link_to '席',
admin_seats_path,
Expand Down
15 changes: 0 additions & 15 deletions app/views/admin/books/_form.html.slim

This file was deleted.

43 changes: 0 additions & 43 deletions app/views/admin/books/_table.html.slim

This file was deleted.

19 changes: 0 additions & 19 deletions app/views/admin/books/edit.html.slim

This file was deleted.

Loading

0 comments on commit 2cefbf6

Please sign in to comment.