Skip to content
  • Ryuta Kamizono's avatar
    64ca6f60
    Avoid extra `BindParam` allocation to generate placeholder in queries · 64ca6f60
    Ryuta Kamizono authored
    In the Active Record usage, a `BindParam` object always has an attribute
    object as the value. A `BindParam` object is used to call `add_bind` to
    generate placeholder if `prepared_statements: true`.
    
    Since Arel is a part of Active Record now, I think that we can regard an
    `ActiveModel::Attribute` object as boundable without wrapping it by a
    `BindParam` to avoid extra `BindParam` allocation.
    64ca6f60
    Avoid extra `BindParam` allocation to generate placeholder in queries
    Ryuta Kamizono authored
    In the Active Record usage, a `BindParam` object always has an attribute
    object as the value. A `BindParam` object is used to call `add_bind` to
    generate placeholder if `prepared_statements: true`.
    
    Since Arel is a part of Active Record now, I think that we can regard an
    `ActiveModel::Attribute` object as boundable without wrapping it by a
    `BindParam` to avoid extra `BindParam` allocation.
Loading