lib/model_discovery/discovery.rb in model_discovery-0.2.2 vs lib/model_discovery/discovery.rb in model_discovery-0.2.3

- old
+ new

@@ -5,20 +5,20 @@ # Discover all model files in gem files and load them all_gems.each do |gem| if gem.groups.include? Rails.env.to_sym or gem.groups.include? :default puts "Gem name: #{gem.name}" - spec = Gem::Specification.find_by_name gem.name + spec = Gem::Specification.find_by(name: gem.name) discover spec.gem_dir end end # Discover models in current rails app and load them discover Rails.root # Create a content type entry for all Models ActiveRecord::Base.subclasses.each do |model| - ApplicationModels.find_or_create_by_model(model.to_s) + ApplicationModels.find_or_create_by(model: model.to_s) end end private