Sha256: c1688da9e044e2c30456cf7405a1bb20925db4984df34478bad8ab02ab2b0a72
Contents?: true
Size: 385 Bytes
Versions: 13
Compression:
Stored size: 385 Bytes
Contents
require "friendly_id" # This override must handle both the situation where locale column has been # added to the slugs table, and also the situation where it has not. # FriendlyId::Slug.class_eval do default_scope { column_names.include?("locale") ? where(locale: ::Mobility.locale) : all } before_save do self.locale ||= ::Mobility.locale if respond_to?(:locale=) end end
Version data entries
13 entries across 13 versions & 1 rubygems