表åé.rb #38 ãRailsã¢ã³ããã¿ã¼ã³ã ã§ãã£ã LT ã§ãã https://omotesandorb.connpass.com/event/98377/ å ãã¿ï¼ http://osa.hatenablog.com/entry/good-bye-before-action-setter
ããç¹å®ã®ãã¡ã¤ã«ã®ãã¹ãã«ãã¬ãã¸ããããç¹å®ã®ãã¹ããã¡ã¤ã«ï¼ç¾¤ï¼ãå®è¡ããã¨ãã«ä¸å®ã®ã«ãã¬ãã¸çã§ãããã¨ãä¿è¨¼ãããã¨æããã¨ã¯ããã¾ããï¼ç§ã¯ããã¾ãã ããã§ã 次ã®ãã㪠spec/coverage_helper.rb ãç¨æãã¦ã spec/rails_helper.rb ãªã©ãã require ããã¨ã COVERAGE_ASSERTION=app/models/ability.rb rspec spec/models/ability_spec.rb:99 ã®ãããªã³ãã³ããCIã§å®è¡ããã¨ãã«ä¸å®ã®ãã¹ãã«ãã¬ãã¸ä»¥ä¸ã®ã¨ãã«CIãã³ã±ãããã«ãã¾ããã # frozen_string_literal: true class CoverageAssertion class CoverageAssertionFailure < StandardError end at
Comes in different flavors: open source, managed, on-premise Pro. Plays nice with Rails, JavaScript/TypeScript, and any backend. Why AnyCable? Low-latency of realtime at scale If your product needs low latency interactivity, communication, or collaboration, AnyCable can be the perfect solution at any stage: start building with a managed (SaaS) version, and move on to the cost efficient Pro version
æ ªå¼ä¼ç¤¾ã¯ãªã¢ã³ã¼ã > ã¯ã¯ãã° > Ruby on Railsã§MySQLã»PostgreSQLã»SQLite3ã¨Groongaã使ã£ã¦æ¥æ¬èªå ¨ææ¤ç´¢ãå®ç¾ããæ¹æ³ MySQLã»PostgreSQLã»SQLite3ã®æ¨æºæ©è½ã§ã¯æ¥æ¬èªããã¹ãã®å ¨ææ¤ç´¢ã«é£ãããã¾ããMySQLã»PostgreSQLã«é«éã»é«æ©è½ãªæ¥æ¬èªå ¨ææ¤ç´¢æ©è½ã追å ããMroongaã»PGroongaã¨ãããã©ã°ã¤ã³ãããã¾ããããããå°å ¥ãããã¨ã«ããSQLã§é«éã»é«æ©è½ãªæ¥æ¬èªå ¨ææ¤ç´¢æ©è½ãå®ç¾ã§ãã¾ãã詳細ã¯ä»¥ä¸ãåç §ãã¦ãã ããã Ruby on Railsã§MySQLã¨Mroongaã使ã£ã¦æ¥æ¬èªå ¨ææ¤ç´¢ãå®ç¾ããæ¹æ³ Ruby on Railsã§PostgreSQLã¨PGroongaã使ã£ã¦æ¥æ¬èªå ¨ææ¤ç´¢ãå®ç¾ããæ¹æ³ ããã§ã¯Mroongaã»PGroongaã使ããã«æ¥æ¬èªå ¨ææ¤ç´¢ãå®ç¾ããæ¹æ³ãç´¹
æ¬ã¬ã¤ãã§ã¯ãAction Cableã®ããã¿ã¨ãWebSocketãRailsã¢ããªã±ã¼ã·ã§ã³ã«å°å ¥ãã¦ãªã¢ã«ã¿ã¤ã æ©è½ãå®ç¾ããæ¹æ³ã«ã¤ãã¦è§£èª¬ãã¾ãã ãã®ã¬ã¤ãã®å 容: Action Cableã®æ¦è¦ãããã¯ã¨ã³ãã¨ããã³ãã¨ã³ãã®çµ±å Action Cableã®è¨å®æ¹æ³ ãã£ãã«ã®è¨å®æ¹æ³ Action Cableåãã®ãããã¤ã¨ã¢ã¼ããã¯ãã£ã®è¨å® 1 ã¯ããã« Action Cableã¯ãWebSocketã¨Railsã®ãã®ä»ã®é¨åãã·ã¼ã ã¬ã¹ã«çµ±åãã¾ããAction Cableãå°å ¥ããã¨ãRails ã¢ããªã±ã¼ã·ã§ã³ã®ããã©ã¼ãã³ã¹ã¨ã¹ã±ã¼ã©ããªãã£ãæãªããã«ãé常ã®Railsã¢ããªã±ã¼ã·ã§ã³ã¨åãã¹ã¿ã¤ã«ã»æ¹æ³ã§ãªã¢ã«ã¿ã¤ã æ©è½ãRubyã§è¨è¿°ã§ããããã«ãªãã¾ããAction Cableã¯ãã«ã¹ã¿ãã¯ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãããã¯ã©ã¤ã¢ã³ãå´ã®JavaScriptãã¬
ä¼ç¤¾ã§GraphQLã®ãã³ãºãªã³ããã£ãã®ããã£ããã«ãæè¿ã¯GraphQLã®ãµã¼ãå´å®è£ ãã¡ãã£ã¨è§¦ã£ã¦ãã¾ãã graphql-rubyã使ãã¨ãRubyã§GraphQL APIãå®è£ ãããã¨ãã§ãã¾ããä»åã¯Railsã§GraphQLã®ã¯ã¨ãªã¨ãã¥ã¼ãã¼ã·ã§ã³ãå®è£ ãã¦ã¿ã¾ããã graphql-ruby使ç¨æã®Railsããã¸ã§ã¯ãã«ããããã¡ã¤ã«ï¼ãã£ã¬ã¯ããªæ§æ rails generate graphql:install ããã¨ãã¸ã§ãã¬ã¼ã¿ã app é ä¸ã«æ¬¡ã®ãããªãã£ã¬ã¯ããªæ§æãä½ãã¾ãã app/controllers âââ graphql_controller.rb app/graphql âââ app_schema.rb âââ mutations âââ types âââ mutation_type.rb âââ query_type.rb ã¾ããã¸ã§ã
æ¨æ¥éå¬ããããIncrements ++ Tech Talkã«ã¦Rails 5.xã¨ããã¿ã¤ãã«ã®è©±ããã¾ããã å 容ã¯WEB+DB PRESSã®é£è¼ã§ã¯ãã¼ã¸æ°ã®é¢ä¿ã§è¼ããããªãã£ãRails 5.0ã®ãããã¯ã¨ãRails 5.1ã§å ¥ã(å ¥ããã)ãªæ©è½ã®è©±ã§ããåéãå¤ããªã£ã¦ãã¾ãããããã端æããªããåãã¾ããã ã¹ã©ã¤ãä¸ã§ã触ãã¦ãã¾ãããçºå£²ä¸ã®WEB+DB PRESS Vol.93ã§Rails 5ã®ã¡ã¸ã£ã¼ãªå¤æ´ã«ã¤ãã¦åãä¸ãæ¸ã¿ã§ãã®ã§ãæ°ã«ãªãæ¹ã¯ãã²ä¸èªãã ããã WEB+DB PRESS Vol.93posted with amazlet at 16.08.19åç° é¨é åç¾½ é¾å¤ªé æ¾æµ¦ é¼äºº é è¤ æ¶¼ä» çæ²¼ ä¸å ¬ æ£®ä¸ é ç« å島 çä¸ éæ²» å ä¸ ä¼è¤ ç´ä¹ ã®ãã ã²ããµã¿ ãããã¿ é«å±± 温 ä½ã æ¨ å¥ä¸ ããã ã¾ãã²ã ã²ãã½ã é è¤ é 伸
ãªãTransactionãå¿ è¦ãªã®ã Transationã®ç®çã¯ããããã³ã¼ããããã¯ã«ããSQLæã®å¤æ´ããå ¨é¨æåãããã¨ãå®ãããã®åå¨ã§ãããTransactionã«ããããã¼ã¿ã®çµ±ä¸æ§ãä¿ãã¨ãã§ãããéè¡ãªã©ã®åãå ¥ãã¨å¼ãåºãã®å¦çã«ã¯å¿ è¦ã§ããããäºã¤ã®å¦çã®ä¸ä¸ã¤ã失æããã¨ãã³ã¼ãããã¼ã¯ã«ããSQLå¦çãå ¨é¨ãã¼ã«ããã¯ãããã®ããTransactionã®ç¹å¾´ã§ããã ActiveRecord::Base.transaction do david.withdrawal(100) mary.deposit(100) end Transationã®ãã¼ã«ããã¯ãçºç«æ¡ä»¶ Railsã§ã¯ããã¼ã«ããã¯ãçºç«ããã«ã¯ããä¾å¤ããå¿ è¦ã§ããããããTransactionã使ãã¨ãã®ãã£ã¨ãéè¦ãªãã¨ã§ããã ä¾ãã°ãRailsã§ã¯ #update_attributeã¯ä¾å¤ã
Railsã§404ã500ã¨ãã£ãã¨ã©ã¼ãã¼ã¸ãåçã«è¡¨ç¤ºããrexceptionã¨ããGemãå ¬éãã¾ããã ã¤ã³ã¹ãã¼ã«æ¹æ³ Gemfileã«ä»¥ä¸ãæ¸ãã¦bundleããã ãã§ä½¿ãã¾ãã gem 'rexception' 使ãæ¹ æãã·ã³ãã«ãªä½¿ãæ¹ã¯ãapp/views/errors/application.html.erbã«ãã¥ã¼ãé ç½®ããã ãã§ãã ããã§ãï¼ææå¯è½ãªï¼ãã¹ã¦ã®ç¨®é¡ã®ã¨ã©ã¼çºçæã«ã対å¿ããã¹ãã¼ã¿ã¹ã³ã¼ãã¨ã¨ãã«ãã¥ã¼ãã¬ã³ããªã³ã°ãã¾ãã not_found.html.erbãinternal_server_error.html.erbãªã©ãã¹ãã¼ã¿ã¹ã«å¯¾å¿ãããã¥ã¼ãé ç½®ããå ´åããã®ãã¥ã¼ãapplication.html.erbãããåªå ãã¦è¡¨ç¤ºããã¾ãï¼ãã¡ã¤ã«åã¯ãã®è¾ºãã®å®è£ ã«æºãã¦ãã¾ãï¼ã ã¾ããã¬ã¤ã¢ã¦ããã¨ã©ã¼ãã¡ã¤ã«é ç½®ãã£ã¬ã¯ããªãç¬
ã¿ããªã®ã¦ã§ãã£ã³ã° æ¾ä¹ ã§ãã ã¿ããªã®ã¦ã§ãã£ã³ã°ã§ã¯ã常ã«ãµã¼ãã¹ãæ¹åããããã«ãæ°ããæ©è½ãå ããããæ¢åã®æ©è½ãå¤æ´ããããã¾ããããããå®éã«ãã®æ©è½ãå ¬éãã¦ã¿ãã¨ãæ³å®ãã¦ããæ°åã®å¤åãèµ·ããªãã£ãããæãã¬ã¨ããã«å½±é¿ãçºçããããããã¨ãããã¾ãã ããã§ãã¿ããªã®ã¦ã§ãã£ã³ã°ã§ã¯ãããã¿ã¤ãã³ã°ãè¡ããä»çµã¿ãåãå ¥ãã¦ãµã¼ãã¹æ¹åãé²ããããã«ãã¾ããã Motorhead ãããã¿ã¤ãã³ã°ã¯ãæ¢åã®æ©è½ãæä¾ãã¤ã¤ãä¸é¨ã®æ©è½ãç¹å®ã®äººã«ã ãå ¬éããä»çµã¿ã§ãããã®ãããªä»çµã¿ãå®ç¾ããããã«ãMotorhead ã¨ãã Ruby ã® gem ãå©ç¨ãã¦ãã¾ããMotorhead ã®èª¬æã«ã¯ä¸è¨ã®ããã«æ¸ããã¦ãã¾ãã Motorhead is a prototyping framework for Rails. Itâs something akin to
èæ¯ railsã¢ããªããã¡ã¼ã«ãéä¿¡ãããã¨ã¯ç°¡åã«ã§ãã¾ãããéçºä¸ã«éä¿¡ã¡ã¼ã«ã確èªãããã¨ãã¯ã©ãããã§ããããã ä»åã¯railsã¢ããªéçºä¸ã«ã¡ã¼ã«ã確èªããæ¹æ³ãç´¹ä»ãã¾ãã æºå ä»åã¯ã¡ã¼ã«ç¢ºèªã®ä¾ã¨ãã¦ãdeviseãç¨ãã¦ã¡ã¼ã«èªè¨¼ãå¿ è¦ãªã¦ã¼ã¶ã¼ç»é²ã®ä»çµã¿ãç¨æãã¾ãã deviseã¤ã³ã¹ãã¼ã« railsã¢ããªã±ã¼ã·ã§ã³ããã§ã«åæåããã¦ããã¨ãã¦ã Gemfileã«deviseã追å ããã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãã bundle exec rails generate devise:install bundle exec rails generate devise user bundle exec rails generate devise:views users
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}