Skip to content

Commit

Permalink
distinct vs uniq
Browse files Browse the repository at this point in the history
  • Loading branch information
TuckerJD committed Feb 9, 2017
1 parent 710f89e commit a4a14e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/collecting_event.rb
Expand Up @@ -781,7 +781,7 @@ def containing_geographic_items
# Struck EGI, EGI must contain GI, therefor anything that contains EGI contains GI, threfor containing GI will always be the bigger set
# !! and there was no tests broken
# GeographicItem.are_contained_in_item('any_poly', self.geographic_items.to_a).pluck(:id).uniq
gi_list = GeographicItem.containing(*geographic_items.pluck(:id)).pluck(:id).distinct
gi_list = GeographicItem.containing(*geographic_items.pluck(:id)).pluck(:id).uniq

else
# use geographic_area only if there are no GIs or EGIs
Expand Down
12 changes: 6 additions & 6 deletions spec/views/users/show.html.erb_spec.rb
@@ -1,16 +1,16 @@
require 'rails_helper'

describe "users/show", :type => :view do
describe 'users/show', :type => :view do
before(:each) do
@user = assign(:user, stub_model(User,
email: "Email@place.come",
created_by_id: 1,
updated_by_id: 1,
name: 'smith'
email: 'Email@place.come',
created_by_id: 1,
updated_by_id: 1,
name: 'smith'
))
end

it "renders attributes in <p>" do
it 'renders attributes in <p>' do
render
expect(rendered).to match(/smith/)
end
Expand Down

0 comments on commit a4a14e4

Please sign in to comment.