Git Product home page Git Product logo

airbnb_clone's People

Contributors

yu-croco avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

airbnb_clone's Issues

js記述をjsファイルに分離する

ビューテンプレートにjsを直書きしている箇所があるので、jsファイルに分離する。
対応時にはwebpackerを調べること。

rails 5 の webpacker 使えば、特定のファイルだけに特定の JS 読み込むのも簡単です。
そこまでやる必要はないですが。

Listingコントローラのfind_by処理を修正する

ご指摘元のコメント

Listing から find_by するのは少し怖いです。
他の User の Listing をまちがって取ってくる可能性があるからです。リクエスト次第では有りえます。

以下のように探してくれば、そのユーザ以外の Listing は表示されないです。

current_user.listings.find_by(...)

Listingsコントローラから一部のアクションを切り出す

現状では、Listingsコントローラに無理にアクションを入れている。
(basics、description、address、price、photos、calendar、bankaccount)
これらをListingsコントローラから切り出して、それぞれに合うコントローラを作成する。
[コメント元]

間違いではないのですが、こういった controller は RESTful の**に反していて、controller が複雑になるかなと思います。
http://postd.cc/how-dhh-organizes-his-rails-controllers/

あとは、可読性も下げる気がしています。

ListingsController#address がどういう情報を表しているのかわかりにくかったりします。
ListingAdressesController#show or #index とかにしておければ、何を表しているのかわかりやすいです。

enumerize導入

コメント元

house_type は選択式ですよね?
これだと意図しない選択肢が DB に残る可能性があって危険です。
enumerize を使うと良いかと。

issueフォーマットを決める

現状、issueへの記載方法が定まっていないのでおよそのフォーマットを決める。
フォーマットはwikiに記載予定。

Circle CIの自動テスト時のエラー解消

[不具合内容]
githubへのpush時に発火するテストが正常に走らない。
(Rails 5.x系でCircle CI繋ぐと、割りと遭遇してるっぽい。?)

bundler:
failed to load command: rspec (/home/circleci/repo/vendor/bundle/ruby/2.4.0/bin/rspec)
LoadError: cannot load such file -- rspec_junit_formatter

DBのnil:false対応

現状でDBスキーマでnull:false対応ができていない箇所があるので、null:falseを追加する。
[対象テーブル/カラム名]

  • listings/house_type
  • listings/active
  • photos/listing_id

[コメント元]

とくに boolean については null: false は徹底したほうがよいです。
true, false, nil, の 3 パターンになってしまって実装が面倒になります。
http://qiita.com/jnchito/items/a342b64cd998e5c4ef3d

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.