design database
This reverts merge request !3 (merged)
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
10 10 </head> 11 11 12 12 <body> 13 14 <% if notice %> 15 <p class="alert alert-success"><%= notice %></p> 16 <% end %> 17 <% if alert %> 18 <p class="alert alert-danger"><%= alert %></p> 19 <% end %> 20 <!-- 21 <% flash.each do |key, value| %> -
Master
this one is better i think, please test, and test with devise flash too
-
-
db/migrate/20180607031349_create_cities.rb 0 → 100644
1 class CreateCities < ActiveRecord::Migration[5.2] 2 def change 3 create_table :cities do |t| 4 t.string :name, limit: 50 -
Master
usually they don't define limit length on SQL because it very easy to cause 500 error on server, they use validate from ActiveModel instead, another reason is AM easier to change limit, you don't need to migrate database.
-
-
spec/models/city_spec.rb 0 → 100644
9 it do 10 should have_db_column(:name).of_type(:string) 11 should have_db_column(:city_type).of_type(:string) 12 should have_db_column(:slug).of_type(:string) 13 should have_db_column(:name_with_type).of_type(:string) 14 should have_db_column(:path).of_type(:string) 15 should have_db_column(:code).of_type(:integer) 16 should have_db_column(:parent_code).of_type(:integer) 17 end 18 end 19 20 it 'should be validates' do 21 expect(city).to be_valid 22 end 23 24 describe 'validations' do -
Master
i think "describe" is not easy to understand
-
-
merged
Toggle commit list