Commit b1b847f2 by Tô Ngọc Ánh

fix syntax rubocop

parent d06a8465
Pipeline #840 canceled with stages
in 0 seconds
...@@ -10,6 +10,6 @@ class Company < ApplicationRecord ...@@ -10,6 +10,6 @@ class Company < ApplicationRecord
private private
def add_slug def add_slug
self.slug = "#{self.to_slug(self.name)}-#{Time.now.to_i}#{rand(10000)}" self.slug = "#{to_slug(name)}-#{Time.now.to_i}#{rand(10_000)}"
end end
end end
...@@ -13,6 +13,6 @@ class Industry < ApplicationRecord ...@@ -13,6 +13,6 @@ class Industry < ApplicationRecord
private private
def add_slug def add_slug
self.slug = "#{self.to_slug(self.name)}-#{Time.now.to_i}#{rand(10000)}" self.slug = "#{to_slug(name)}-#{Time.now.to_i}#{rand(10_000)}"
end end
end end
...@@ -18,6 +18,6 @@ class Location < ApplicationRecord ...@@ -18,6 +18,6 @@ class Location < ApplicationRecord
private private
def add_slug def add_slug
self.slug = "#{self.to_slug(self.city)}-#{Time.now.to_i}#{rand(10000)}" self.slug = "#{to_slug(city)}-#{Time.now.to_i}#{rand(10_000)}"
end end
end end
...@@ -2,21 +2,21 @@ namespace :create_slug do ...@@ -2,21 +2,21 @@ namespace :create_slug do
desc 'Create slug model Location' desc 'Create slug model Location'
task locations: :environment do task locations: :environment do
Location.all.each do |location| Location.all.each do |location|
location.update_attributes(slug: "#{location.to_slug(location.city)}-#{Time.now.to_i}#{rand(10000)}") location.update_attributes(slug: "#{location.to_slug(location.city)}-#{Time.now.to_i}#{rand(10_000)}")
end end
end end
desc 'Create slug model Industry' desc 'Create slug model Industry'
task industries: :environment do task industries: :environment do
Industry.all.each do |industry| Industry.all.each do |industry|
industry.update_attributes(slug: "#{industry.to_slug(industry.name)}-#{Time.now.to_i}#{rand(10000)}") industry.update_attributes(slug: "#{industry.to_slug(industry.name)}-#{Time.now.to_i}#{rand(10_000)}")
end end
end end
desc 'Create slug model Company' desc 'Create slug model Company'
task companies: :environment do task companies: :environment do
Company.all.each do |company| Company.all.each do |company|
company.update_attributes(slug: "#{company.to_slug(company.name)}-#{Time.now.to_i}#{rand(10000)}") company.update_attributes(slug: "#{company.to_slug(company.name)}-#{Time.now.to_i}#{rand(10_000)}")
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment