diff --git a/Gemfile b/Gemfile index cfcf7f0..a9d8f5c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,10 @@ source 'http://rubygems.org' gem 'rails', '>= 4.2' +gem 'sass-rails', '>= 6' gem 'turbolinks', '>= 2' gem 'kaminari', '>= 0' gem 'haml-rails', '>= 0' -gem 'sass-rails', '>= 5' group :development do diff --git a/app/controllers/bhf/entries_controller.rb b/app/controllers/bhf/entries_controller.rb index 4a577dc..f1a8781 100644 --- a/app/controllers/bhf/entries_controller.rb +++ b/app/controllers/bhf/entries_controller.rb @@ -168,7 +168,7 @@ def load_new_object def manage_many_to_many return unless params[:has_and_belongs_to_many] params[:has_and_belongs_to_many].each_pair do |relation, ids| - next unless ids.any? + next unless ids.empty? reflection = @model.reflections[relation] relation_array = @object.send(relation) reflection.klass.unscoped.find(ids.keys).each do |relation_obj| @@ -208,7 +208,7 @@ def manage_has_many return unless params[:has_many] object_id = @object.send(@model.bhf_primary_key) params[:has_many].each_pair do |relation, ids| - next unless ids.any? + next unless ids.empty? reflection = @model.reflections[relation] preset_ids = @object.send(relation).collect do |object| object.send(object.class.bhf_primary_key).to_s diff --git a/lib/bhf.rb b/lib/bhf.rb index b765d00..6eacb27 100644 --- a/lib/bhf.rb +++ b/lib/bhf.rb @@ -1,5 +1,4 @@ require 'haml' -require 'sass' require 'turbolinks' require 'kaminari' @@ -24,7 +23,7 @@ class Engine < Rails::Engine end initializer 'bhf.assets.precompile' do |app| - app.config.assets.precompile += %w( bhf/logo_bhf.svg ) + app.config.assets.precompile += %w( bhf/application.css bhf/application.js bhf/logo_bhf.svg ) end end