Dir.chdir(VENDOR_PATH) do begin exec "yarnpkg #{ARGV.join(" ")}" rescue Errno::ENOENT puts "Yarn executable was not detected in the system." puts "Download Yarn at https://yarnpkg.com/en/docs/install" end end 一時node_modulesがvendor配下に置かれた時期もあ ったが、最終的にはRails root配下に置かれるようになって いる
driven_by :selenium, using: :chrome, screen_size: [1400, 1400] end # test/system/todos_test.rb require "application_system_test_case" class TodosTest < ApplicationSystemTestCase # test "visiting the index" do # visit todos_url # # assert_selector "h1", text: "Todo" # end end
store the encryption key: bf55aca3c137840f7 Save this in a password manager your team can access. If you lose the key, no one, including you, can access any encrypted secrets. create config/secrets.yml.key Ignoring config/secrets.yml.key so it won't end up in Git history: append .gitignore Adding config/secrets.yml.enc to store secrets that needs to be encrypted. create config/secrets.yml.enc
@invitee = params[:inviter], params[:invitee before_action { @account = params[:inviter].account } default to: -> { @invitee.email_address }, from: -> { common_address(@inviter) }, reply_to: -> { @inviter.email_address_with_name } def account_invitation mail subject: "#{@inviter.name} invited you to their Basecamp (#{ end def bulk_project_invitation @projects = params[:projects].sort_by(&:name) mail subject: "#{@inviter.name.familiar} added you to some new stuff in end
"http://www.rubyonrails.org" end direct :commentable do |model| [ model, anchor: model.id ] end direct :main do { controller: "page", action: "index" } end direct :browse, page: 1, size: 10 do |options| [ :products, options.merge(params.permit(:page, :size).to_h.symbolize_ke end end
オプションも渡せる resolve "Basket", anchor: "items" do |basket, options| [:basket, options] end end # actionが`/basket#items`になる <%= form_for @basket do |form| %> <!-- basket form --> <% end %>
Rendered messages/_message.html.erb in 1.2 ms Write fragment views/v1/2914079/v1/2914079/recordings/70182313-2016022501503 Rendered recordings/threads/_thread.html.erb in 1.5 ms after Rendered messages/_message.html.erb in 1.2 ms [cache hit] Rendered recordings/threads/_thread.html.erb in 1.5 ms [cache miss] 古いフォーマットを使用したい場合は con g.action_controller.enable_fragment_cache_loggin にtrueを設定すればOK
] end def people if @events.first.detail.people.any? @events.collect { |e| Array(e.detail.people) }.flatten.uniq else @events.collect(&:creator).uniq end end private def respond_to_missing?(name, include_private = false) @events.respond_to?(name, include_private) end
[ first_event ] end def people if @events.first.detail.people.any? @events.collect { |e| Array(e.detail.people) }.flatten.uniq else @events.collect(&:creator).uniq end end end
User < ApplicationRecord after_save :post_processing def post_processing puts changed? end end User.create! # => DEPRECATION WARNING: The behavior of `changed?` inside of after callbac # => DEPRECATION WARNING: The behavior of `changed_attributes` inside
FOR NEW TABLES 新規に作成するテーブルのprimary keyに、PostgreSQL は"bigserial"を、MySQLでは"bigint"をそれぞれ使用する ようになった 型を変更した事によるパフォーマンスの影響は無い為との 事 参考: 合わせて読みたい: "Postgres reminder: train yourself to use BIGSERIAL, and never SERIAL…" Restore the behaviour of the compatibility layer for integer-like PKs
た場合 ActiveRecord::Deadlocked がraiseされるよう修 正された 上のPRではエラークラス名が DeadlockDetected に なっているが、後から Deadlocked に変更されている The problem isn't the detection but the deadlock itself