You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
3 ways to do eager loading (preloading) in Rails 3, 4, 5 and 6 ⦠and check why 5600+ Rails engineers read also this 3 ways to do eager loading (preloading) in Rails 3, 4, 5 and 6 You are probably already familiar with the method #includes for eager loading data from database if you are using Rails and ActiveRecord. But do you know why you someties get few small and nice SQL queries and sometimes o
ããã°ã©ã ã¯ããªãã¹ãä½ãããªãã¦ãè¯ãæãã«åãã¦ãããã®ãçæ³çã ãã©ãå®éã«ã¯ä½ããã®ããã¡ã§ã¦ã¼ã¶ã®è¨å®ãå¿ è¦ã¨ãããã¨ãããã Rails ã使ãã¨ã㯠config/application.rb ã§ã¿ã¤ã ã¾ã¼ã³ãæå®ããããDB ã¸æ¥ç¶ããããã®æ å ±ã config/database.yml ã«æå®ããã Bundler ã®æåãå¤ããããã° bundle config ã§è¨å®ãå¤æ´ããã Gem ãã¤ã³ã¹ãã¼ã«ããã¨ãã«æ¯åæå®ããããªãã·ã§ã³ãããã°ã~/.gemrc ã«è¿½è¨ããã ããèªåã®é¢ãããããã¯ãã«ãè¨å®ãã®APIãå¿ è¦ã«ãªã£ãã¨ããä½ãå¤æã®åºæºã«ãã¦è¨è¨ããã°ããã ããã ã¡ãã£ã¨è¿æãè¦æ¸¡ãã ãã§ãããè¨å®ãã®ããæ¹ã«ã¯è²ã ããããã ã è¨å®ã¨ããè¦ç¹ãããRubyist ã«ã¨ã£ã¦èº«è¿ãªãããã¯ããã¡ãè³æã¨ãã¦çºãã¦ã¿ãã (NOTE: ã¡ãã£ã¨æ©ã¿ãªã
in our rails apps we always have an '/su' or 'super user' section. we dump stuff like reports into that backend. recently i needed to allow super users to view logs in realtime from the browser (to assist debugging firewall issues for a license server we built). i considered doing something clever like websockets and then i became sane and just decided to do the simplest thing that could possibly
æ¨é¡ã®éãæ¬ãåºã¦ãããã«é¢ãã£ã¦ãã¾ãã ã¾ãã¯ãå ±èè 諸æ°ã®è¨äºãã®ä»ããåç §ãã ããã ãã¼ãã§ã¯ããªRailsã®æ¬ãæ¸ãã¾ãã - joker1007ã®æ¥è¨ ãã¼ãã§ã¯ã Ruby on Rails ã¨ããæ¬ãæ¸ãã¾ãã - willnet.in Twitter / Search - #sugamasao_sushi æ¬ã®å£²ãã¨ã willnetããã¨jokerããã®ã¨ã³ããªã®éããªãã§ãããRails 4.1ã«æ»ãè¾¼ã¿ã§å¯¾å¿ãããã¨ã¯ããã¾ãããã¨ä½ãããæ¢ãã¦å 容ã«ãç¾å ´ã£ã½ããä»äºã§ãã£ã¨ä½¿ã£ã¦ããã¨ã³ã¸ãã¢ã®è¦³ç¹ã£ã½ãããã¤ã¢ã¹ãæãã¦ããã¨ããã ã¨æãã¾ãã å人çã«ã¯ãä»ã¾ã§æ¸ç±ã¨ããå½¢ã§ã¯åããã¼ãã¦ãããããªRailsã®ãã£ã¼ãã£ã¼ã®èª¬æã¨ããä¸ç¤ãããç¨åº¦ãã£ã¡ãããã¢ããªã®è¨è¨ãã³ã¼ãã£ã³ã°ããã¹ãããµã¼ãã®ãããã¸ã§ãã³ã°ããããã¤ãç£è¦è¨å®ã¾ã§ãä¸æ°é貫ã§ã
â [ruby] Ruby 2.1 ã®ãµãã¡ã³ããã«ãªãã¾ããã®ãç¥ãã ã¡ã¤ã³ã¡ã³ãã㯠@nagachika ããã§ãã ä»ã¾ã§ Ruby 㯠stable branch ã«ã¡ã³ãããä¸äººã¨ããéçºä½å¶ãåã£ã¦ãããã§ãããä¸äººã¨ããã®ã¯ã¡ã³ããã³ã¹ããªã·ã¼ãã¯ã£ããããã¦ç²ã ã¨ä½æ¥åºæ¥ãã¨ããã¡ãªãããããä¸æ¹ã§ãç·æ¥ãªãªã¼ã¹ãå¿ è¦ãªäºæ ã§ãä½æ¥ã®ãªã½ã¼ã¹ã確ä¿ã§ããªãã¨ãªãªã¼ã¹ãããã¨ãã§ããªãã¨ãããã¡ãªãããåå¨ãã¦ãã¾ããã ããã§ä»åããã¯ãã¼ãããªãªã¼ã¹ã«ã¤ãã¦ã¯ãã¡ã¤ã³ã¡ã³ããã®æ¿èªãå¾ãä¸ã§åãã§ããããã«ãªãã¾ããããªã®ã§ãã¡ã¸ã£ã¼OSã«å«ã¾ãã¦ãã readline ã®ãã¼ã¸ã§ã³ãåå ã§ãã«ãåºæ¥ãªããã¿ãããªåé¡ãçºçããå ´åãããã ãç´ãããã¼ã¸ã§ã³ããªãªã¼ã¹ãããå¯è½æ§ãã¡ãã£ã¨ã ãé«ããªãã¾ããã ãã以å¤ã«ãå®å®çããã£ã¨æ°è»½ã«ãªãªã¼ã¹ã§ããããã«ãå¤æ°
Ever since moving to Ruby 1.9 Iâve suffered through slow startup times with Rails apps. The first improvement came when a patch to require was included in 1.9.3. This sped things up a bit but for some reason the GC configs have escaped my radar until now. Rather than blindly use the configuration variables that have been posted around I wanted to understand them a little before implementing them.
Rubyã¯ãã¼ã«ã«å¤æ°ã¸ã®åç §ã¨ç¡å¼æ°ã®ã¡ã½ããå¼ã³åºããåãè¨æ³ã§æ¸ããã®ã§ãã³ã¼ããèªãã¨ãã«æ··ä¹±ãããtypoã§NoMethodErrorãåºãã¦ãã£ãããããã¨ãå¤ã ããã¾ãã 幸ããªãã¨ã«ãããã¯éçã«è§£æãããã¨ãã§ããã®ã§ããã¼ã«ã«å¤æ°ã¸ã®åç §ãè²ä»ãããVimãã©ã°ã¤ã³ãæ¸ããã Github/ruby_hl_lvar.vim ããã便å©ãªæ°ãããï¼ï¼ï¼ï¼ï¼ï¼ï¼ Rubyã¤ã³ã¿ãã§ã¼ã¹(>=1.9)ãæå¹ã«ãªã£ãVimãå¿ è¦ãªã®ã§ã注æãã ãããMacVim 7.4 KaoriYa 20140107ã§åä½ç¢ºèªãã¾ããã ããã¿ Ruby1.9以éã«æ¨æºæ·»ä»ããã¦ããripperã¨ããã©ã¤ãã©ãªã§ãRubyã®æ§æ解æããã¦ãã¼ã«ã«å¤æ°ã¸ã®åç §ãåãåºãã¦ãã¾ãã require 'ripper' Ripper.sexp(<<EOS) a = 10 b = 20 c = a +
Getting Started I want to get this out of the way right now, in contrast to other popular Ruby testing frameworks such as Test::Unit, Shoulda and RSpec, Riot does not run a setup and teardown sequence before and after each test 1. This speeds up test execution quite a bit, but also changes how you write your tests. In general and in my opinion, you should avoid mutating any objects under test and
ç®æ¬¡ ã¯ããã« Abstract Classãã¿ã¼ã³ Abstract Classãã¿ã¼ã³Rubyç (by å©ç°é ç´ãã) Balkingãã¿ã¼ã³ Before/Afterãã¿ã¼ã³ Futureãã¿ã¼ã³ Futureãã¿ã¼ã³Rubyç (by å©ç°é ç´ãã) Generation Gapãã¿ã¼ã³ Hook Operationãã¿ã¼ã³ Hook Operationãã¿ã¼ã³Rubyç (by å©ç°é ç´ãã) Immutableãã¿ã¼ã³ Marker Interfaceãã¿ã¼ã³ Monostateãã¿ã¼ã³ Monostateãã¿ã¼ã³Rubyç (by å©ç°é ç´ãã) Monostateãã¿ã¼ã³Perlç (by å®®å·ãã) Null Objectãã¿ã¼ã³ Null Objectãã¿ã¼ã³ã¨Singletonãã¿ã¼ã³ Producer-Consumerãã¿ã¼ã³ Sharableãã¿ã¼ã³ Singl
In Technology Preview 1 weâve shown that Phusion Passenger 3 can be up to 55% faster on OS X. Performance is good and all, but it wonât do you any good unless the software keeps running. When Phusion Passenger goes down itâs an annoyance at best, but in the worst case any amount of down time can cost your organization real money. Any HTTP request thatâs dropped can mean a lost transaction. Althoug
Google+ãã¿ã³ ã¯ã¦ãªããã¯ãã¼ã¯ãã¿ã³ æ´æ°æ¥æ: 2014å¹´01æ11æ¥ï¼åï¼ ä½ææ¥æ: 2013å¹´11æ12æ¥ï¼ç«ï¼ åã®è¨äº / 次ã®è¨äº Rails4ã§ã¯å¾æ¥ã® page cache ã action cache ã¯å»æ¢ããã ããã©ã«ãã®ãã£ãã·ã¥æ©æ§ã¨ãã¦ã¯ãRails3ã¾ã§ã® fragment cache ã®ãããªãã®ã ãã使ããã Rails4ã®ãã®ãã£ãã·ã¥æ©æ§ã¯ä»ã®ã¨ãã RussianDollCachingãcache_digestsãfragment cache ç㨠å¼ã°ãã¦ããã¿ããã ãã©æã示ããã®ã¯å ¨é¨åããã®ã ã¨ãããæåå¥ã ã®ä½ãã ã¨æã£ã¦ã¦ç¡é§ã«åµã¾ã£ãã Rails4ã§å é¨çã«ä½¿ããã¦ããgemãã å¾æ¥ã®Railsã«ããã fragment cache ãé²åããã cache_digests ã§ããã cache_digestsã®ä»çµ
By the end of this talk you should: Understand the mechanics of Ruby failure handling Be able to architect a robust failure handling strategy For apps or libraries. Be exceptionally bored This talk is about failure Exceptions are how we signal failures Failures are often caused by errors So what is a failure?
Rubyã«ãããraiseã¨failã®ä½¿ãåãã«ã¤ãã¦ã ä¹ ã ã«rubocopãåããããã app/models/user.rb:139:7: C: Use `fail` instead of `raise` to signal exceptions. raise Exceptions::AlreadyChecked, msg ^^^^^ ãããªæãã§ãraiseãããªãã¦failã使ããã¿ãããªè¦åãçµæ§åºãã 2ã¤ã®ãã¼ã¯ã¼ãã®ä½¿ãåãã«ã¤ãã¦ã¡ãã£ã¨èª¿ã¹ã¦ã¿ãã¨ãããExceptional Rubyã¨ããã¹ã©ã¤ãã®10æç®ãraise (or fail)ãã«ã¦ãJim Weirichæ°ã«ãã以ä¸ã®ãããªã³ã¡ã³ããå¼ç¨ããã¦ããã I almost always use the "fail" keyword⦠the only time I use "raise" is when I
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}