Run rubocop --fix-layout and remove encoding comments
This commit is contained in:
parent
fa63e6e81d
commit
ea2862fdef
283 changed files with 1164 additions and 1969 deletions
|
|
@ -1,18 +1,18 @@
|
|||
class CreateSuppliers < ActiveRecord::Migration[4.2]
|
||||
SUPPLIER_SAMPLE = 'Sample Supplier'
|
||||
|
||||
def self.up
|
||||
SUPPLIER_SAMPLE = 'Sample Supplier'
|
||||
|
||||
def self.up
|
||||
add_column :groups, :role_suppliers, :boolean, :default => false, :null => false
|
||||
Group.reset_column_information
|
||||
puts "Give #{CreateGroups::GROUP_ADMIN} the role supplier .."
|
||||
raise "Failed" unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_suppliers, true)
|
||||
raise "Cannot find admin user!" unless admin = User.find_by_nick(CreateUsers::USER_ADMIN)
|
||||
raise "Failed to enable role_suppliers with admin user!" unless admin.role_suppliers?
|
||||
|
||||
|
||||
create_table :suppliers do |t|
|
||||
t.column :name, :string, :null => false
|
||||
t.column :address, :string, :null => false
|
||||
t.column :phone, :string, :null => false
|
||||
t.column :name, :string, :null => false
|
||||
t.column :address, :string, :null => false
|
||||
t.column :phone, :string, :null => false
|
||||
t.column :phone2, :string
|
||||
t.column :fax, :string
|
||||
t.column :email, :string
|
||||
|
|
@ -23,12 +23,12 @@ class CreateSuppliers < ActiveRecord::Migration[4.2]
|
|||
t.column :order_howto, :string
|
||||
t.column :note, :string
|
||||
end
|
||||
add_index(:suppliers, :name, :unique => true)
|
||||
|
||||
add_index(:suppliers, :name, :unique => true)
|
||||
|
||||
# Create sample supplier...
|
||||
puts "Creating sample supplier '#{SUPPLIER_SAMPLE}'..."
|
||||
Supplier.create(:name => SUPPLIER_SAMPLE, :address => "Organic City", :phone => "0123-555555")
|
||||
raise "Failed!" unless supplier = Supplier.find_by_name(SUPPLIER_SAMPLE)
|
||||
raise "Failed!" unless supplier = Supplier.find_by_name(SUPPLIER_SAMPLE)
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue