Skip to content

Commit

Permalink
Check ActiveRecord version instead of Rails version in Reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
bencollab authored and magnusvk committed Sep 5, 2017
1 parent 6d8f0f5 commit 29fafac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/counter_culture/reconciler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

module CounterCulture
class Reconciler
ACTIVE_RECORD_VERSION = Gem.loaded_specs["activerecord"].version

attr_reader :counter, :options, :changes

delegate :model, :relation, :full_primary_key, :relation_reflect, :polymorphic?, :to => :counter
Expand Down Expand Up @@ -221,7 +223,7 @@ def quote_table_name(table_name)
end

def parameterize(string)
if Rails.version < '5.0'
if ACTIVE_RECORD_VERSION < Gem::Version.new("5.0")
string.parameterize('_')
else
string.parameterize(separator: '_')
Expand Down

0 comments on commit 29fafac

Please sign in to comment.