Skip to content

Commit

Permalink
link analytics to models
Browse files Browse the repository at this point in the history
  • Loading branch information
loftwah committed Sep 21, 2024
1 parent 9829c33 commit 4fe9a59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/achievement.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Achievement < ApplicationRecord
belongs_to :user
has_many :achievement_views
has_many :achievement_views, dependent: :destroy

validates :title, presence: true
validates :date, presence: true
Expand Down
2 changes: 1 addition & 1 deletion app/models/link.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Link < ApplicationRecord
belongs_to :user
has_many :link_clicks
has_many :link_clicks, dependent: :destroy

scope :visible, -> { where(visible: true) }
scope :pinned, -> { where(pinned: true) }
Expand Down

0 comments on commit 4fe9a59

Please sign in to comment.