Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ db/structure.sql

# Ignore IDE config files
.idea/
.DS_Store
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ gem "jbuilder"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt", "~> 3.1.7"

gem "csv"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ windows jruby ]

Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ GEM
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
crass (1.0.6)
csv (3.3.2)
date (3.4.1)
debug (1.10.0)
irb (~> 1.10)
Expand Down Expand Up @@ -436,6 +437,7 @@ DEPENDENCIES
brakeman
bullet
capybara
csv
debug
factory_bot_rails
faker
Expand Down
3 changes: 2 additions & 1 deletion app/models/language.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class Language < ApplicationRecord
validates :name, presence: true, uniqueness: true, length: { minimum: 2 }
has_many :topics, dependent: :destroy
validates :name, presence: true, uniqueness: true

def file_storage_prefix
return "" if name.downcase == "english" || name.nil?
Expand Down
2 changes: 1 addition & 1 deletion app/models/region.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Region < ApplicationRecord
has_many :branches
has_many :branches, dependent: :destroy
has_many :providers, through: :branches

validates :name, presence: true
Expand Down
5 changes: 0 additions & 5 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/compiled/css/app.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/compiled/css/app-dark.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/compiled/css/iconly.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/extensions/simple-datatables/style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/scss/pages/simple-datatables.scss">

<style>
#app {
Expand Down Expand Up @@ -91,8 +89,5 @@
</footer>
</div>
</div>

<script src="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/extensions/simple-datatables/umd/simple-datatables.js"></script>
<script src="https://cdn.jsdelivr.net/gh/zuramai/mazer@docs/demo/assets/static/js/pages/simple-datatables.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion app/views/topics/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<% @topics.each do |topic| %>
<tr>
<td class="text-bold-500"><%= topic.title %></td>
<td class="text-bold-500"><%= topic.description.truncate(25, omission: "...") %></td>
<td class="text-bold-500"><%= topic.description.truncate(25, omission: "...") unless topic.description.blank? %></td>
<td class="text-bold-500"><%= topic.uid.truncate(10, omission: "...") %></td>
<td class="text-bold-500"><%= topic.language.name %></td>
<td class="text-bold-500"><%= topic.provider.name %></td>
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class Application < Rails::Application
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
config.eager_load_paths << Rails.root.join("lib/autorequire")
end
end
6 changes: 6 additions & 0 deletions db/migrate/20250218193602_add_old_id_to_providers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddOldIdToProviders < ActiveRecord::Migration[8.0]
def change
add_column :providers, :old_id, :integer
add_index :providers, :old_id, unique: true
end
end
6 changes: 6 additions & 0 deletions db/migrate/20250218194646_add_old_id_to_topics.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddOldIdToTopics < ActiveRecord::Migration[8.0]
def change
add_column :topics, :old_id, :integer
add_index :topics, :old_id, unique: true
end
end
8 changes: 8 additions & 0 deletions db/migrate/20250218203303_allow_nullable_topic_description.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class AllowNullableTopicDescription < ActiveRecord::Migration[8.0]
def up
change_column :topics, :description, :text, null: true
end
def down
change_column :topics, :description, :text, null: false
end
end
6 changes: 5 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading