lib/permalink.rb in permalink-2.0.0 vs lib/permalink.rb in permalink-2.1.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require "active_record" require "permalink/active_record" require "permalink/normalizations/contraction" require "permalink/normalizations/downcase" require "permalink/normalizations/leading_trailing_dashes" @@ -13,16 +15,16 @@ Normalizations::Downcase, Normalizations::Contraction, Normalizations::NonAlphanumeric, Normalizations::MultipleDashes, Normalizations::LeadingTrailingDashes - ] + ].freeze DEFAULT_OPTIONS = { normalizations: DEFAULT_NORMALIZATIONS, separator: "-" - } + }.freeze def self.generate(input, options = DEFAULT_OPTIONS) options = DEFAULT_OPTIONS.merge(options) options[:normalizations].each do |normalization| @@ -31,6 +33,6 @@ input end end -ActiveRecord::Base.send(:include, Permalink::ActiveRecord) +ActiveRecord::Base.include Permalink::ActiveRecord