Commit 061d0d8689331cba31cccd2e59d599fae9723647
1 parent
87b2b511
Exists in
rails5
rails5: replace #find_by_* calls with #find_by
Showing
3 changed files
with
3 additions
and
5 deletions
Show diff stats
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
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 | ... | ... |