Commit 061d0d8689331cba31cccd2e59d599fae9723647

Authored by Braulio Bhavamitra
1 parent 87b2b511
Exists in rails5

rails5: replace #find_by_* calls with #find_by

app/models/unit.rb
... ... @@ -2,9 +2,6 @@ class Unit < ActiveRecord::Base
2 2  
3 3 acts_as_list scope: -> unit { where environment_id: unit.environment_id }
4 4  
5   - validates_presence_of :singular
6   - validates_presence_of :plural
7   -
8 5 belongs_to :environment
9 6  
10 7 validates_presence_of :environment_id
... ...
config/initializers/dependencies.rb
... ... @@ -26,4 +26,5 @@ require 'authenticated_system'
26 26 require 'needs_profile'
27 27 require 'white_list_filter'
28 28 require 'notify_activity_to_profiles_job'
  29 +require 'profile_suggestions_job'
29 30  
... ...
features/step_definitions/noosfero_steps.rb
... ... @@ -15,7 +15,7 @@ Given /^the following users?$/ do |table|
15 15 end
16 16  
17 17 Given /^"(.+)" is (invisible|visible)$/ do |user, visibility|
18   - User.find_by(login: user).person.update({visible: (visibility == 'visible')}, without_protection: true)
  18 + User.find_by(login: user).person.update visible: (visibility == 'visible')
19 19 end
20 20  
21 21 Given /^"(.+)" is (online|offline|busy) in chat$/ do |user, status|
... ... @@ -225,7 +225,7 @@ Given /^the following states$/ do |table|
225 225 table.hashes.each do |item|
226 226 data = item.dup
227 227 if validator = Enterprise.find_by(name: data.delete("validator_name"))
228   - State.create!(data.merge(:environment => Environment.default, :validators => [validator]), :without_protection => true)
  228 + State.create! data.merge(environment: Environment.default, validators: [validator])
229 229 else
230 230 r = State.create!(data.merge(:environment => Environment.default))
231 231 end
... ...