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