Skip to content
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

Added prefixed_ids and hashid #20

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ gem "appsignal"
gem "acts_as_list"

gem 'friendly_id', '~> 5.4.0'
gem "prefixed_ids", "~> 1.6", ">= 1.6.1"
gem "hashid-rails", "~> 1.4", ">= 1.4.1"

gem 'acts-as-taggable-on', '>= 10'

Expand Down
9 changes: 9 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ GEM
activerecord (>= 4.0.0)
globalid (1.2.1)
activesupport (>= 6.1)
hashid-rails (1.4.1)
activerecord (>= 4.0)
hashids (~> 1.0)
hashids (1.0.6)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
Expand Down Expand Up @@ -269,6 +273,9 @@ GEM
orm_adapter (0.5.0)
pagy (7.0.10)
pg (1.5.5)
prefixed_ids (1.6.1)
hashids (>= 1.0.0, < 2.0.0)
rails (>= 6.0.0)
psych (5.1.2)
stringio
public_suffix (5.0.4)
Expand Down Expand Up @@ -419,12 +426,14 @@ DEPENDENCIES
factory_bot_rails
faker
friendly_id (~> 5.4.0)
hashid-rails (~> 1.4, >= 1.4.1)
image_processing (~> 1.2)
importmap-rails
jbuilder
mapkick-rb
mini_magick
pg (>= 0.18, < 2.0)
prefixed_ids (~> 1.6, >= 1.6.1)
puma (~> 5.0)
pundit
rails (>= 7.1.0)
Expand Down
1 change: 1 addition & 0 deletions app/models/spouse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# person_id :bigint
#
class Spouse < Person
include Hashid::Rails
gabrielgiroe1 marked this conversation as resolved.
Show resolved Hide resolved
belongs_to :person, optional: true, inverse_of: :spouse

def self.ransackable_attributes(auth_object = nil)
Expand Down
1 change: 1 addition & 0 deletions app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# url :string
#
class Team < ApplicationRecord
has_prefix_id :team
gabrielgiroe1 marked this conversation as resolved.
Show resolved Hide resolved
validates :name, presence: true

has_many :memberships, class_name: 'TeamMembership', foreign_key: :team_id, inverse_of: :team
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "application.tailwind", "inter-font", "data-turbo-track": "reload" %>
gabrielgiroe1 marked this conversation as resolved.
Show resolved Hide resolved

<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %>
Expand Down