ä»å¹Ž11æ5ã6æ¥ã«ããšãã§éå¬ãããRubyCã«ã³ãã¡ã¬ã³ã¹ã§Steveãšè©±ãããšãã§ããŸãã
ç§ã¯ããRailsã§Rubyãæãããšäººã ã«èšããŸãã ããã¯ææªã®æ¹æ³ã®1ã€ã§ããããã®é ã«ã¯ãã§ã«å€ãã®ããã°ã©ãã³ã°èšèªãåŠãã§ããã®ã§ãæ°ã«ããŸããã§ããã ãã ããããã«ãããRailsã¢ããªã±ãŒã·ã§ã³ã«å¿ èŠãªã¯ã©ã¹ãã©ãã»ã©æ éã«èšèšãããŠãããã«ã€ããŠãå°ããããã æèŠãåŸãããŸããã 幞ããªããšã«ãç§ã¯ä»äººã«ãã£ãŠæžãããã³ãŒããåèŠã§ã¬ãã¥ãŒããŠãããç§ãå°æ¬ããå€ãã®äººã ã®çºå±ã«éèŠãªããšãäžã€ããããšã«æ°ã¥ããŸããã
ãããã®äººã ããã®ããšããŠããŒã¯ã ãšèããŠããããã§ãã ããã¯ãè¯ãã³ãŒãã®æžãæ¹ãç¥ããªã人ãè©ŠããŠã¿ããšãã§ã¯ãããŸããããããã§ãã²ã©ãå€æããŸãã ããã¯æãä¿¡å·ã®ãããªãã®ã§ãã ããŠãç§ã誰ãããã®ããšãã©ã®ããã«å®è£ ããããèŠããšããç§ã¯ããã«èããŸãïŒã圌ã¯umbleããã ç§ã¯èªåã®æ°æã¡ãä¿¡ãããããããããŸãããããã®é«åºŠãªéçºææ³ã¯ãRailsã¢ããªã±ãŒã·ã§ã³ã«çžäºæ¥ç¶ãããå€ãã®å©ç¹ãæäŸãã䜿ããããããã¹ãã1æ¡ä»¥äžé«éåããŸãã æ®å¿µãªãããå€ãã®åå¿è ã®Railséçºè ã«ãšã£ãŠããã¯æããã§ã¯ãããŸããããã³ãŒããããè¯ãæžããŠããã ããããšæããŸãã
ãå€ãã·ã³ãã«ãªRubyãªããžã§ã¯ãããšåŒã°ããŸã
ã¯ããæ£ç¢ºã«ã Rubyã¯äœãç¶æ¿ããªãã¯ã©ã¹ã§ãã ãšãŠãã·ã³ãã«ãªã®ã§ãç®ç«ã€å Žæã«é ãããŠããŸãã Railsã®äœæè ã«æãããŠãããå€ãã·ã³ãã«ãªRubyãªããžã§ã¯ãããŸãã¯ãPOROãã¯ãäžéšã®äººã ãããããåŒã¶ããšã奜ãããã«ãè€éãã«å¯Ÿããé ãããæŠåšã§ãã ãããç§ã®æå³ã§ãã ãã®ãåçŽãªãã¢ãã«ãæ€èšããŠãã ããã
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
Copy Source | Copy HTML class Post < ActiveRecord::Base def self .as_dictionary dictionary = ( 'A' .. 'Z' ).inject({}) {|h, l| h[l] = []; h} Post .all.each do | p | dictionary[ p .title[ 0 ]] << p end dictionary end end
ãã¹ãŠã®æçš¿ã®æåã®æåã§ã€ã³ããã¯ã¹ã衚瀺ããŸãã ãããè¡ãã«ã¯ãèŸæžãäœæããããã«æçš¿ãé 眮ããŸãã ãªã¹ããããŒãžã«åå²ããå¿ èŠããªãã®ã§ãããŒã¿ããŒã¹ããã®ãã¹ãŠã®æçš¿ã®ãªã¯ãšã¹ãã«æ³šæãæããªããšããŸãã ã¢ã€ãã¢ã¯éèŠã§ãããã¹ãŠã®æçš¿ãååã§è¡šç€ºã§ããããã«ãªããŸããã
Copy Source | Copy HTML
- -Post.as_dictionary do |ã¬ã¿ãŒããªã¹ã|
- ïŒ p =æå
- ïŒ ul
- -list.each do | post |
- ïŒ li = link_to post
ãã¡ããã äžæ¹ã§ãã³ãŒãã¯æªããããŸããã ãããããããè¯ããããŸãããããžãã¹ããžãã¯çšã«èšèšãããã¢ãã«å ã®ãã¬ãŒã³ããŒã·ã§ã³ãå¿é ã§ãã ãã¬ãŒã³ã¿ãŒãã¿ãŒã³ã䜿çšããŠãããä¿®æ£ããŸãããã
Copy Source | Copy HTML
- ã¯ã©ã¹ DictionaryPresenter
- def initialize ïŒã³ã¬ã¯ã·ã§ã³ïŒ
- @collection =ã³ã¬ã¯ã·ã§ã³
- çµãã
- def as_dictionary
- èŸæž=ïŒ 'A' .. 'Z' ïŒ.injectïŒ{}ïŒ{| hãl | h [l] = []; h}
- @ collection.each do | p |
- èŸæž[ p .title [ 0 ]] << p
- çµãã
- èŸæž
- çµãã
- çµãã
ããã§ãDictionaryPresenter.newïŒPost.allïŒ.as_dictionaryã䜿çšã§ããŸãã ããã«ã¯å€ãã®å©ç¹ããããŸããã¢ãã«ãããã¬ãŒã³ããŒã·ã§ã³ããžãã¯ãåé€ããŸããã ãã§ã«æ°ããæ©èœãè¿œå ãããŠããŸããã©ã®ã³ã¬ã¯ã·ã§ã³ããã€ã³ã¿ã§è¡šç€ºã§ããããã«ãªããŸããã ãã®ä»£è¡šçãªã¯ã©ã¹ã«å¯ŸããŠåå¥ã®ãã¹ããç°¡åã«æžãããšãã§ãããããã¯é«éã«ãªããŸãã
代衚ãã¿ãŒã³ã«å¯Ÿããç§ã®æã«ããããããããã®æçš¿ã¯åœŒã«é¢ãããã®ã§ã¯ãããŸããã ãã®ååã¯ãããã®æŠå¿µã¯ç¬èªã®ã¯ã©ã¹ã«å€ããããšããä»ã®å Žæã«ãçŸããŠããŸãã å¥ã®äŸã«ç§»ãåã«ããã®äŸãæ¡åŒµããŸããããæçš¿ãååã§äžŠã¹æ¿ããå Žåããã®ã¯ã©ã¹ã¯æ©èœããŸããããŠãŒã¶ãŒã«ã¯ã¿ã€ãã«ïŒã¿ã€ãã«ãã£ãŒã«ãïŒããªããããããšãã°ãŠãŒã¶ãŒã衚瀺ããããšã¯ã§ããŸããã ããã«ãååã¯èšäºãaãã§å§ãŸãããšãå€ãããããAãã«é¢ããå€æ°ã®æçš¿ãåãåããŸããå®éã2çªç®ã®åèªã®æåã®æåãå¿ èŠã§ãã 2çš®é¡ã®ä»£è¡šè ãäœæã§ããŸãããã³ãã¥ããã£ã倱ããããã€ã³ããã¯ã¹ãã®æŠå¿µã«åã³2人ã®ä»£è¡šè ãã·ã¹ãã ã«è¿œå ãããŸãã ããªããæ£ããç解ããããã«ïŒPOROã¯ç§ãã¡ãæããŸãïŒ
代衚ãå°ãå€æŽããŠãããªã·ãŒãªããžã§ã¯ããåãå ¥ããŸãã
Copy Source | Copy HTML
- ã¯ã©ã¹ DictionaryPresenter
- def åæå ïŒããªã·ãŒãã³ã¬ã¯ã·ã§ã³ïŒ
- @policy =ããªã·ãŒ
- @collection =ã³ã¬ã¯ã·ã§ã³
- çµãã
- def as_dictionary
- èŸæž=ïŒ 'A' .. 'Z' ïŒ.injectïŒ{}ïŒ{| hãl | h [l] = []; h}
- @ collection.each do | p |
- èŸæž[@ policy.category_forïŒ p ïŒ] << p
- çµãã
- èŸæž
- çµãã
- çµãã
ããã§ãããªã·ãŒãè¿œå ããŠãç°ãªãããªã·ãŒãäœæã§ããŸãã
Copy Source | Copy HTML
- ã¯ã©ã¹ UserCategorizationPolicy
- def self .category_forïŒãŠãŒã¶ãŒïŒ
- user.username [ 0 ]
- çµãã
- çµãã
- ã¯ã©ã¹ PostCategorizationPolicy
- def self .category_forïŒæçš¿ïŒ
- if post.starts_withïŒïŒ "A" ïŒ
- post.titleã split [ 1 ] [ 0 ]
- ä»ã«
- post.title [ 0 ]
- çµãã
- çµãã
- çµãã
ãã ïŒ
Copy Source | Copy HTML
- DictionaryPresenterã æ°èŠ ïŒPostCategorizationPolicyãPost.allïŒ.as_dictionary
ã¯ããå°ãé·ããªã£ãŠããŸãã ããã¯èµ·ãããŸã:)ãããä»ãããªãã¯åæŠå¿µãç§ãã¡ã®ã·ã¹ãã ã«äžã€ã®ã¢ã€ãã¢ãæã£ãŠããããšãããããŸãã 代衚è ã¯ãç©äºãã©ã®ããã«é 眮ãããããæ°ã«ãããæ¿æ²»å®¶ã ããããããã©ã®ããã«é 眮ãããããæ瀺ããŸãã å®éãç§ã®ååã¯å°ãããããã§ãããããããå®éã«ã¯ãUsernamePolicyããŸãã¯ãTitlePolicyããšåŒã¶æ¹ãè¯ãã§ãããã ç§ãã¡ã¯åœŒããã©ããªã¯ã©ã¹ãªã®ãããæ°ã«ããŸããïŒ
ãããŠãã¹ãŠã«ãããŠã Rubyã®æè»æ§ãšãç¶æ¿ã³ãŒãã䜿çšããå¹æçãªäœæ¥ãã®ç§ã®ãæ°ã«å ¥ãã®äŸãçµã¿åãããããšã§ãè€éãªèšç®ããªããžã§ã¯ãã«å€ããããšãã§ããŸãã ãã®ã³ãŒããèŠãŠãã ããïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ Quote < ActiveRecord :: Base
- ïŒ<snip>
- def pretty_turnaround
- ã¿ãŒã³ã¢ã©ãŠã³ãã®å Žå㯠ããã è¿ããŸãã ãŒã ïŒ
- purchase_atã®å Žå
- ãªãã»ãã= purchase_at
- days_from_today =ïŒïŒ Time .now-purchase_at.to_timeïŒ/ 60/60/24ïŒ.floor + 1
- ä»ã«
- ãªãã»ãã= Time .now
- days_from_today =æèŠæé+ 1
- çµãã
- æé=ãªãã»ãã+ïŒã¿ãŒã³ã¢ã©ãŠã³ã* 60 * 60 * 24 ïŒ
- if ïŒtime.strftimeïŒ "ïŒ a" ïŒ== "Sat" ïŒ
- æé+ = 2 * 60 * 60 * 24
- elsif ïŒtime.strftimeïŒ "ïŒ a" ïŒ== "Sun" ïŒ
- æé+ = 1 * 60 * 60 * 24
- çµãã
- ãïŒ{time.strftimeïŒ " ïŒ AïŒ dïŒ B "ïŒ}ïŒïŒ{days_from_today}ä»æ¥ããå¶æ¥æ¥ïŒã
- çµãã
- çµãã
ããïŒ ãã®ã¡ãœããã¯æ»ãïŒèšç®ïŒæéã衚瀺ããŸãããã芧ã®ãšãããããã¯è€éãªèšç®ã§ãã ã¡ãœããæœåºïŒMethod Extractãªãã¡ã¯ã¿ãªã³ã°ã¡ãœããïŒãæ°å䜿çšããŠåå²ãããšããããããç°¡åã«ç解ã§ããŸãããæéã®èšç®ã«ã®ã¿å¿ èŠãªå€ãã®ã³ãŒãã§Quoteã¯ã©ã¹ãè©°ãŸãããå±éºããããŸãã ãŸããã¢ãã«ããã¬ãŒã³ããŒã·ã§ã³ããžãã¯ãå®è£ ããŠãããšããäºå®ãèŠãªãã§ãã ãããããã¯é¢åãªã³ãŒãã®äŸã«ãããŸããã
ãããã£ãŠããã®ãªãã¡ã¯ã¿ãªã³ã°ã®æåã®ã¹ãããã¯ãFeatherïŒãã¬ã¬ã·ãŒã³ãŒããå¹æçã«äœ¿çšãããã®èè ïŒããã¡ãœãããªããžã§ã¯ãã®ãã¬ãŒã¯ã¢ãŠãããšåŒã¶ãã®ã§ãã 330ããŒãžã®ãã¬ã¬ã·ãŒã³ãŒããå¹æçã«äœ¿çšãããã®ã³ããŒãéãã詳现ãèªãããšãã§ããŸãã æã£ãŠããªãå Žåã¯ãè³Œå ¥ããŠãã ãã:)ã å®éãæ°ãæ£ã£ãŠããŸããŸããã ã¢ã¯ã·ã§ã³ãã©ã³ã¯æ¬¡ã®ãšããã§ãã
1.æ°ããèšç®ã¯ã©ã¹ãäœæããŸãã
2.æ°ããæ¹æ³ã§äœæ¥ããæ¹æ³ãå®çŸ©ããŸãã
3.å€ãã¡ãœããã®æ¬äœãã³ããŒãããã€ã³ã¿ãŒãžã®åç §ããªããžã§ã¯ãã«çœ®ãæããŸãã
4.ã¹ããã3ã§äœ¿çšãããå€æ°ãå²ãåœãŠãããã®åŒæ°ãåãã³ã³ã¹ãã©ã¯ã¿ãŒãäœæããŸãã
5.å€ãã¡ãœãããæ°ããã¯ã©ã¹ãšã¡ãœããã«å§ä»»ããŸãã
ã³ã³ãã€ã©ïŒLean On The CompilerïŒã«é Œãããšãã§ããªããããRubyã®å ã®ãã³ãã¬ãŒããå°ãå€æŽããFeatherãããã«å¯ŸåŠããããã€ãã®æé ãå®è¡ããŸããã ãšã«ããããã®ã³ãŒããè©ŠããŠã¿ãŸãããã ã¹ããã1ïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ Quote < ActiveRecord :: Base
- def pretty_turnaround
- ïŒã¹ããã
- çµãã
- ã¯ã©ã¹ TurnaroundCalculator
- çµãã
- çµãã
第äºïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ TurnaroundCalculator
- def èšç®
- çµãã
- çµãã
第äžïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ TurnaroundCalculator
- def èšç®
- @turnaroundã®å Žå㯠ãããè¿ããŸãã ãŒã ïŒ
- if @purchased_at
- ãªãã»ãã= @purchased_at
- days_from_today =ïŒïŒ Time .now-purchase_at.to_timeïŒ/ 60/60/24ïŒ.floor + 1
- ä»ã«
- ãªãã»ãã= Time .now
- days_from_today = @turnaround + 1
- çµãã
- æé=ãªãã»ãã+ïŒ@ã¿ãŒã³ã¢ã©ãŠã³ã* 60 * 60 * 24 ïŒ
- if ïŒtime.strftimeïŒ "ïŒ a" ïŒ== "Sat" ïŒ
- æé+ = 2 * 60 * 60 * 24
- elsif ïŒtime.strftimeïŒ "ïŒ a" ïŒ== "Sun" ïŒ
- æé+ = 1 * 60 * 60 * 24
- çµãã
- ãïŒ{time.strftimeïŒ " ïŒ AïŒ dïŒ B "ïŒ}ïŒïŒ{days_from_today}ä»æ¥ããå¶æ¥æ¥ïŒã
- çµãã
- çµãã
æåã«éåžžã®ååãä»ããŠã圌ãæ£ç¢ºã«äœãããã®ããæ確ã«ãªã£ãåŸãã¹ããã5ã§ååãå€æŽãããã§ãã ã»ãšãã©ã®å Žåãã³ãŒãèªäœãé©åãªååãæããŠãããŸãã
4çªç®ïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ TurnaroundCalculator
- def åæå ïŒpurchased_atãã¿ãŒã³ã¢ã©ãŠã³ãïŒ
- @purchased_at = purchase_at
- @turnaround =ã¿ãŒã³ã¢ã©ãŠã³ã
- çµãã
- def èšç®
- ïŒã¹ããã
- çµãã
- çµãã
5çªç®ïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ Quote < ActiveRecord :: Base
- def pretty_turnaround
- TurnaroundCalculatorã æ°èŠ ïŒpurchased_atãã¿ãŒã³ã¢ã©ãŠã³ãïŒ.calculate
- çµãã
- çµãã
ã§ããïŒ ãã¹ããå®è¡ããã©ã®ããã«åæ Œãããã確èªããå¿ èŠããããŸãã ããã¹ããå®è¡ããããšã¯ãæåã§ãã§ãã¯ããããšãæå³ããå Žåã§ã...
ããã§ã¯ãå©ç¹ã¯äœã§ããïŒ ããŠãããã§ãªãã¡ã¯ã¿ãªã³ã°ããã»ã¹ãéå§ã§ããŸãããç§ãã¡ã¯èªåã®å°ããªã¯ãªãŒã³ã«ãŒã ã«ããŸãã Quoteã¯ã©ã¹ãè©°ãŸãããããšãªãTurnaroundCalcuatorã¯ã©ã¹ã«ã¡ãœãããè¿œå ã§ããŸããCalculatorã®ã¿ã®ã¯ã€ãã¯ãã¹ããèšè¿°ããåŸã§ç°¡åã«å€æŽã§ããã³ã³ãã¥ãŒãã£ã³ã°ã®ã¢ã€ãã¢ã1ãæã§å解ã§ããŸãã ããã€ãã®ãªãã¡ã¯ã¿ãªã³ã°åŸã®ã¯ã©ã¹ã¯æ¬¡ã®ãšããã§ãã
Copy Source | Copy HTML
- ã¯ã©ã¹ TurnaroundCalculator
- def èšç®
- @turnaroundã®å Žå㯠ãããè¿ããŸãã ãŒã ïŒ
- ãïŒ{arrival_date}ïŒïŒ{days_from_today}æ¬æ¥ããã®å¶æ¥æ¥ïŒã
- çµãã
- ä¿è·ããã
- def å°çæ¥
- real_turnaround_time .strftimeïŒ "ïŒ AïŒ dïŒ B" ïŒ
- çµãã
- def real_turnaround_time
- adjust_time_for_weekends ïŒ start_time + turnaround_in_seconds ïŒ
- çµãã
- def adjust_time_for_weekends ïŒæéïŒ
- if saturday ïŒïŒæéïŒ
- æé+ 2 * 60 * 60 * 24
- elsif sunday ïŒïŒæéïŒ
- æé+ 1 * 60 * 60 * 24
- ä»ã«
- æé
- çµãã
- çµãã
- def saturday ïŒïŒæéïŒ
- time.strftimeïŒ "ïŒ a" ïŒ== "å"
- çµãã
- def sunday ïŒïŒæéïŒ
- time.strftimeïŒ "ïŒ a" ïŒ== "Sun"
- çµãã
- def turnaround_in_seconds
- @ã¿ãŒã³ã¢ã©ãŠã³ã* 60 * 60 * 24
- çµãã
- def start_time
- @purchased_at ãŸã㯠Time .now
- çµãã
- def days_from_today
- if @purchased_at
- ïŒïŒ Time .now-@ purchase_at.to_timeïŒ/ 60/60/24ïŒ.floor + 1
- ä»ã«
- @ã¿ãŒã³ã¢ã©ãŠã³ã+ 1
- çµãã
- çµãã
- çµãã
ããïŒ 3幎åã«æžãããã®ã³ãŒãã¯å®å šã§ã¯ãããŸããããã»ãšãã©ç解ã§ããŸãã ãããŠããã¹ãŠã®äœåã¯çã«ããªã£ãŠããŸãã ããã¯ããªãã¡ã¯ã¿ãªã³ã°ã®2ã€ãŸãã¯3ã€ã®æ³¢ã®åŸã§ããããã¯ãå¥ã®æçš¿ã§æããã«ãããããããŸããã ãããã«ãããããªãã¯ãã®èããç解ããŠããŸãã ããã¯ãRubyã®5è¡ã®ã¡ãœããã«çŠç¹ãåãããŠãããšããããšã§ãã ã³ãŒããæ確ã§ããã°ãç°¡åã«ç·šéã§ããŸãã
Rubyã®ã¯ãªãŒã³ãªããžã§ã¯ããååŸãããšããèãã¯ãRailsã§ãåœãŠã¯ãŸããŸãã ãã®ã«ãŒããèŠãŠãã ããïŒ
Copy Source | Copy HTML
- ã«ãŒãïŒto => 'dashboardïŒindex' ãïŒconstraint => LoggedInConstraint
ãïŒ LoggedInConstraintïŒ
Copy Source | Copy HTML
- ã¯ã©ã¹ LoggedInConstraint
- def self .matchesïŒïŒãªã¯ãšã¹ãïŒ
- current_user
- çµãã
- çµãã
A.ã¯ãã ã«ãŒãã£ã³ã°ããªã·ãŒãèšè¿°ãããªããžã§ã¯ãã ããã æ€èšŒã®äŸãomgbloglolã§æ¥ç¥ããã«çãŸããŸãã ïŒ
Copy Source | Copy HTML
- def SomeClass < ActiveRecord ::ããŒã¹
- validateïŒcategory_idãïŒproper_category => true
- çµãã
- ã¯ã©ã¹ ProperCategoryValidator <ActiveModel :: EachValidator
- def validate_each ïŒã¬ã³ãŒããå±æ§ãå€ïŒ
- record.user.category_idsãé€ããŸãã include ïŒïŒå€ïŒ
- èšé²ã ãšã©ãŒ .addå±æ§ã ãã«ããŽãªãééã£ãŠããŸããã
- çµãã
- çµãã
- çµãã
ããã¯çŽç²ãªRubyã¯ã©ã¹ã§ã¯ãããŸããããããªãã¯ãã®èããç解ããŠããŸãã
ãã¹ãã£ãŒããRailsã ãã§ã¯ãªããåãã€ããïŒããšæããããããŸããããããã¯ããå®éãããªãã¯ç§ãæãŸããŸããã ãããã決ããŠã¯ã©ã¹ãå£ããªããšããtrapã«ããªããèªæããããã«æãããRailsç¹æã®äœãããããŸãã ãã¶ãlib /ã¯ãã®ãããªãŽããªããžããªã®ããã§ãã 15åéã®äŸã«ActiveRecordã¢ãã«ã®ã¿ãå«ãŸããŠããå¯èœæ§ããããŸãã ãããããéRailsãéããããéããRailsã¢ããªã±ãŒã·ã§ã³ã®æ¹ãå€ãïŒæ³šïŒç§èªèº«ã®æèŠã ãã§ãïŒã®ã§ãä¿¡é Œã§ããè¯ãäŸã¯ããŸããããŸããã ïŒRailsã¯äŒæ¥åãã®ãµã€ãéçºã«ãã䜿çšããããããç§ã¯ãã®èããæã£ãŠããŸããå®ç³ïŒãŸãã«ïŒç§ã®Webã¢ããªã±ãŒã·ã§ã³ïŒããã»ã©ã§ã¯ãããŸãããããã§ãã確èªããçµ±èšããããŸãããïŒ
äžè¬çã«ããã¡ã€ã³ãªããžã§ã¯ãã®ååŸã¯é©åã§ãã ãã¹ããé«éåããã³ãŒããçãããå°æ¥ã®å€æŽã容æã«ããŸãã ç§ã¯ãŸã ããã«ã€ããŠãç¹ã«ãã¯ã€ãã¯ãã¹ããã«ã€ããŠäœãèšãããããšããããŸãããç§ã¯ãã§ã«æçš¿ã®å¯èœãªé·ãã䜿ãæãããŸããã 次åãŸã§ïŒ