-
-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: [FEAT] Custom Links in Dropdown Menu #5718
Changes from 3 commits
5c15b07
10e78b9
5910151
88e5893
22fbe5b
e046020
a697e10
c25ba65
53b95c2
33a0d41
ebbb863
ab5454a
a7b39b3
be36735
9a5df29
e801d16
3fd889b
c3dcacb
136111b
8fb37fa
cce5956
1d0d5d7
4942caf
f020367
4d2d99b
e905bb1
dded9f9
990f96b
3f6847f
b8f25bf
a514b3f
6d8a7aa
8b923fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
class CustomLink < ApplicationRecord | ||
belongs_to :casa_org | ||
end | ||
|
||
# == Schema Information | ||
# | ||
# Table name: custom_links | ||
# | ||
# id :bigint not null, primary key | ||
# text :string | ||
# url :text | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# casa_org_id :bigint not null | ||
# | ||
# Indexes | ||
# | ||
# index_custom_links_on_casa_org_id (casa_org_id) | ||
# | ||
# Foreign Keys | ||
# | ||
# fk_rails_... (casa_org_id => casa_orgs.id) | ||
# |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -52,7 +52,6 @@ def user_org_learning_topic_enable? | |||||
# id :bigint not null, primary key | ||||||
# duration_hours :integer not null | ||||||
# duration_minutes :integer not null | ||||||
# learning_type :integer default(5) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting diff - at some point we need to figure out why this keeps appearing and disappearing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. This thing drives me nuts in my code. Also I feel like I messed it up. @elasticspoon any ideas? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be removed. It looks like
It probably should have been removed but somehow got left in? I suspect what is going on is it exists in the schema because someone forgot to commit the removal. Most people do a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would leave it in for now simply because I think the removal might mess up the seeding. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nepaakash revert this change for now |
||||||
# name :string not null | ||||||
# occurred_at :datetime not null | ||||||
# created_at :datetime not null | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateCustomLinks < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :custom_links do |t| | ||
t.string :text | ||
t.text :url | ||
t.references :casa_org, null: false, foreign_key: true | ||
t.timestamps | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
# | ||
# It's strongly recommended that you check this file into your version control system. | ||
|
||
ActiveRecord::Schema[7.1].define(version: 2024_05_07_022441) do | ||
ActiveRecord::Schema[7.1].define(version: 2024_05_13_155246) do | ||
# These are extensions that must be enabled in order to support this database | ||
enable_extension "plpgsql" | ||
|
||
|
@@ -298,6 +298,15 @@ | |
t.index ["judge_id"], name: "index_court_dates_on_judge_id" | ||
end | ||
|
||
create_table "custom_links", force: :cascade do |t| | ||
t.string "text" | ||
t.text "url" | ||
t.bigint "casa_org_id", null: false | ||
t.datetime "created_at", null: false | ||
t.datetime "updated_at", null: false | ||
t.index ["casa_org_id"], name: "index_custom_links_on_casa_org_id" | ||
end | ||
|
||
create_table "delayed_jobs", force: :cascade do |t| | ||
t.integer "priority", default: 0, null: false | ||
t.integer "attempts", default: 0, null: false | ||
|
@@ -420,7 +429,6 @@ | |
|
||
create_table "learning_hours", force: :cascade do |t| | ||
t.bigint "user_id", null: false | ||
t.integer "learning_type", default: 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this change for now |
||
t.string "name", null: false | ||
t.integer "duration_minutes", null: false | ||
t.integer "duration_hours", null: false | ||
|
@@ -684,6 +692,7 @@ | |
add_foreign_key "contact_topic_answers", "contact_topics" | ||
add_foreign_key "contact_topics", "casa_orgs" | ||
add_foreign_key "court_dates", "casa_cases" | ||
add_foreign_key "custom_links", "casa_orgs" | ||
add_foreign_key "emancipation_options", "emancipation_categories" | ||
add_foreign_key "followups", "users", column: "creator_id" | ||
add_foreign_key "judges", "casa_orgs" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FactoryBot.define do | ||
factory :custom_link do | ||
|
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe CustomLink, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add tests before merging There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes sure... It is still a work in progress |
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add some validation on the url and the text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task is still in progress... Will definitely add those