method

from_attachable_sgid

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: Attachable
from_attachable_sgid(sgid, options = {}) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actiontext/lib/action_text/attachable.rb, line 41
      def from_attachable_sgid(sgid, options = {})
        method = sgid.is_a?(Array) ? :locate_many_signed : :locate_signed
        record = GlobalID::Locator.public_send(method, sgid, options.merge(for: LOCATOR_NAME))
        record || raise(ActiveRecord::RecordNotFound)
      end

      private
        def attachable_from_sgid(sgid)
          from_attachable_sgid(sgid)
        rescue ActiveRecord::RecordNotFound
          nil
        end
    end
Register or log in to add new notes.