{"id":114573,"date":"2023-10-07T10:38:11","date_gmt":"2023-10-07T01:38:11","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=114573"},"modified":"2023-10-07T10:38:11","modified_gmt":"2023-10-07T01:38:11","slug":"rails-7-1","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/rails-7-1\/","title":{"rendered":"Rails 7.1\u6b63\u5f0f\u7248\u304c\u30ea\u30ea\u30fc\u30b9 - Dockerfile\u3084\u8a8d\u8a3c\u30b7\u30b9\u30c6\u30e0\u306e\u6539\u5584\u3001\u975e\u540c\u671f\u30af\u30a8\u30ea\u306e\u62e1\u5145\u306a\u3069\u65b0\u6a5f\u80fd\u591a\u6570"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2023\/10\/s_20231007_102723.jpg\" alt=\"S 20231007 102723\" title=\"s_20231007_102723.jpg\" border=\"0\" width=\"860\" height=\"470\" \/><\/p>\n<p>Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f10\u67085\u65e5(\u73fe\u5730\u6642\u9593)\u3001Rails\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u7248\u300cRails 7.1\u300d\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f(<a href=\"https:\/\/rubyonrails.org\/2023\/10\/5\/Rails-7-1-0-has-been-released\">\u516c\u5f0f\u30d6\u30ed\u30b0<\/a>)\u3002\u3053\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u306f\u3001Rails 7.0\u4ee5\u964d\u3001800\u4eba\u4ee5\u4e0a\u306e\u8ca2\u732e\u8005\u306b\u3088\u3063\u30665,000\u3092\u8d85\u3048\u308b\u30b3\u30df\u30c3\u30c8\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Rails 7.1\u3067\u306f\u3001\u65b0\u898f\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u751f\u6210\u3059\u308b\u969b\u306b\u3001Docker\u95a2\u9023\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u4f5c\u6210\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3001Docker\u3092\u4f7f\u7528\u3057\u3066\u672c\u756a\u74b0\u5883\u306bRails\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3068\u3057\u3066\u6a5f\u80fd\u3057\u3001\u958b\u767a\u76ee\u7684\u3067\u306f\u306a\u3044\u3068\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre>\ndocker build -t app .\ndocker volume create app-storage\ndocker run --rm -it -v app-storage:\/rails\/storage -p 3000:3000 --env RAILS_MASTER_KEY=<your-config-master-key> app\n<\/pre>\n<p>\u307e\u305f\u3001\u958b\u767a\u8005\u304c\u72ec\u81ea\u306e\u8a8d\u8a3c\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u65b0\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u524d\u306b\u5c5e\u6027\u3092\u6b63\u898f\u5316\u3059\u308b\u306e\u306b\u4fbf\u5229\u306a<code>normalizes<\/code>\u3084\u3001\u30e6\u30fc\u30b6\u8a8d\u8a3c\u306e\u969b\u306b\u4e00\u822c\u7684\u306a\u30bf\u30a4\u30df\u30f3\u30b0\u653b\u6483\u304b\u3089\u4fdd\u8b77\u3059\u308b<code>authenticate_by<\/code>\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u30ea\u30bb\u30c3\u30c8\u306a\u3069\u30c8\u30fc\u30af\u30f3\u3092\u5fc5\u8981\u3068\u3059\u308b\u6a5f\u80fd\u305f\u3081\u306e<code>generate_token_for<\/code>\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u66f4\u65b0\u6642\u306b\u73fe\u5728\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u81ea\u52d5\u7684\u306b\u691c\u8a3c\u3067\u304d\u308b<code>has_secure_password<\/code>\u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>has_secure_password\u306e\u4f7f\u7528\u4f8b: <\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-ruby\" data-lang=\"Ruby\"><code>\n# Schema: User(name:string, password_digest:string)\nclass User < ActiveRecord::Base\n  has_secure_password\nend\n\nuser = User.new(name: \"rafael\", password: \"railsrocks\", password_confirmation: \"railsrocks\")\nuser.save                                                                      # => true\nuser.update(password: \"pwn3d\", password_challenge: \"\")                         # => false, challenge doesn't authenticate\nuser.update(password: \"railsGetsEvenBetter\", password_challenge: \"railsrocks\") # => true\n\n<\/code><\/pre>\n<\/div>\n<p>Active Record\u306e\u975e\u540c\u671f\u30af\u30a8\u30ea\u304c\u62e1\u5145\u3055\u308c\u3001\u8907\u6570\u306e\u9045\u3044\u30af\u30a8\u30ea\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u51e6\u7406\u3092\u9032\u3081\u306a\u304c\u3089\u4e26\u884c\u3057\u3066\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u975e\u540c\u671f\u96c6\u8a08(count\u3001sum\u306a\u3069)\u3001\u5358\u4e00\u30ec\u30b3\u30fc\u30c9\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3001Relation\u4ee5\u5916\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>async_count<\/li>\n<li>async_sum<\/li>\n<li>async_minimum<\/li>\n<li>async_maximum<\/li>\n<li>async_average<\/li>\n<li>async_pluck<\/li>\n<li>async_pick<\/li>\n<li>async_find_by_sql<\/li>\n<li>async_count_by_sql<\/li>\n<\/ul>\n<p>Trilogy MySQL\u30a2\u30c0\u30d7\u30bf\u306e\u7d44\u307f\u8fbc\u307f\u30b5\u30dd\u30fc\u30c8\u3084\u3001\u8907\u5408\u4e3b\u30ad\u30fc\u306e\u30b5\u30dd\u30fc\u30c8\u3001\u5927\u91cf\u306e\u30b8\u30e7\u30d6\u3092\u540c\u6642\u306b\u30a8\u30f3\u30ad\u30e5\u30fc\u3059\u308b<code>perform_all_later<\/code>\u306e\u8ffd\u52a0\u3001<code>config.autoload_lib<\/code>\u3068<code>config.autoload_lib_once<\/code>\u306e\u5c0e\u5165\u306b\u3088\u308b\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u306e\u5f37\u5316\u3001JavaScript\u30e9\u30f3\u30bf\u30a4\u30e0Bun\u306e\u30b5\u30dd\u30fc\u30c8\u306a\u3069\u3001\u3055\u307e\u3056\u307e\u306a\u65b0\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Ruby on Rails 7.1\u306e\u65b0\u6a5f\u80fd\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/edgeguides.rubyonrails.org\/7_1_release_notes.html\">\u30ea\u30ea\u30fc\u30b9\u30ce\u30fc\u30c8<\/a>\u3067\u3082\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rails\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f10\u67085\u65e5(\u73fe\u5730\u6642\u9593)\u3001Rails\u306e\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u7248\u300cRails 7.1\u300d\u3092\u30ea\u30ea\u30fc\u30b9\u3057\u307e\u3057\u305f(\u516c\u5f0f\u30d6\u30ed\u30b0)\u3002\u3053\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u306f\u3001Rails 7.0\u4ee5\u964d\u3001800\u4eba\u4ee5\u4e0a\u306e\u8ca2\u732e\u8005\u306b\u3088\u3063\u30665,00 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":114574,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3158],"tags":[350],"class_list":["post-114573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sale","tag-rails"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/114573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=114573"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/114573\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/114574"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=114573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=114573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=114573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}