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
private
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
......@@ -13,6 +13,6 @@ class Industry < ApplicationRecord
private
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
......@@ -18,6 +18,6 @@ class Location < ApplicationRecord
private
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
......@@ -2,21 +2,21 @@ namespace :create_slug do
desc 'Create slug model Location'
task locations: :environment do
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
desc 'Create slug model Industry'
task industries: :environment do
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
desc 'Create slug model Company'
task companies: :environment do
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
......
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