now this is what i call an app
This commit is contained in:
commit
8063246b68
97 changed files with 1989 additions and 0 deletions
3
app/models/application_record.rb
Normal file
3
app/models/application_record.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class ApplicationRecord < ActiveRecord::Base
|
||||
primary_abstract_class
|
||||
end
|
||||
0
app/models/concerns/.keep
Normal file
0
app/models/concerns/.keep
Normal file
4
app/models/current.rb
Normal file
4
app/models/current.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class Current < ActiveSupport::CurrentAttributes
|
||||
attribute :session
|
||||
delegate :user, to: :session, allow_nil: true
|
||||
end
|
||||
3
app/models/session.rb
Normal file
3
app/models/session.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Session < ApplicationRecord
|
||||
belongs_to :user
|
||||
end
|
||||
4
app/models/tape.rb
Normal file
4
app/models/tape.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class Tape < ApplicationRecord
|
||||
has_one_attached :video
|
||||
validates :title, presence: true
|
||||
end
|
||||
6
app/models/user.rb
Normal file
6
app/models/user.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class User < ApplicationRecord
|
||||
has_secure_password
|
||||
has_many :sessions, dependent: :destroy
|
||||
|
||||
normalizes :email_address, with: ->(e) { e.strip.downcase }
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue