Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
stokarenko committed Feb 19, 2019
1 parent e4875ea commit b40b64c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/activerecord-import/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,10 @@ def import_helper( *args )
default_values = column_defaults
stored_attrs = respond_to?(:stored_attributes) ? stored_attributes : {}
serialized_attrs = if defined?(ActiveRecord::Type::Serialized)
attrs = column_names.select { |c|
attrs = column_names.select do |c|
attribute_type = type_for_attribute(c.to_s)
attribute_type.class == ActiveRecord::Type::Serialized || %i[json jsonb].include?(attribute_type.type)
}
attribute_type.class == ActiveRecord::Type::Serialized || %i(json jsonb).include?(attribute_type.type)
end
Hash[attrs.map { |a| [a, nil] }]
else
serialized_attributes
Expand Down
4 changes: 2 additions & 2 deletions test/support/postgresql/import_examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ def should_support_postgresql_import_functionality
end
end

%w[json jsonb].each do |json_type|
%w(json jsonb).each do |json_type|
describe "with pure #{json_type} fields" do
let(:data) { {a: :b} }
let(:data) { { a: :b } }
let(:json_field_name) { "pure_#{json_type}_data" }
it "imports the values from saved records" do
vendor = Vendor.create!(name: 'Vendor 1', json_field_name => data)
Expand Down

0 comments on commit b40b64c

Please sign in to comment.