adding teacher profiles
This commit is contained in:
@ -20,8 +20,8 @@ class Entity < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.response(path = "")
|
||||
host = Rails.credentials.weather_dev
|
||||
host = Rails.credentials.weather_pro if Rails.env.production?
|
||||
host = Rails.application.credentials.weather_dev
|
||||
host = Rails.application.credentials.weather_pro if Rails.env.production?
|
||||
token = Rails.application.credentials.weather_token
|
||||
begin
|
||||
all = RestClient.get( "#{host}:8123/api/states#{path}" ,
|
||||
|
@ -7,11 +7,10 @@ class Member < ApplicationRecord
|
||||
mount_uploader :picture, PictureUploader
|
||||
|
||||
has_many :entities
|
||||
has_one :teacher
|
||||
|
||||
def admin
|
||||
true
|
||||
end
|
||||
def admin?
|
||||
true
|
||||
email == "torsten@villataika.fi"
|
||||
end
|
||||
alias :admin :admin?
|
||||
end
|
||||
|
10
app/models/teacher.rb
Normal file
10
app/models/teacher.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class Teacher < ApplicationRecord
|
||||
belongs_to :member
|
||||
|
||||
validates :name , presence: true
|
||||
validates :bio , presence: true
|
||||
validates :picture , presence: true
|
||||
|
||||
mount_uploader :picture, PictureUploader
|
||||
|
||||
end
|
Reference in New Issue
Block a user