Class: Testimonial

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Checkable, FlatPriority, Toggleable
Defined in:
app/models/testimonial.rb

Overview

Testimonial

Attributes:

created_at [DateTime]
data [jsonb]
date [date]
image [SimpleImageUploader], optional
language_id [Language]
name [string]
priority [integer]
text [text]
url [string], optional
updated_at [DateTime]
visible [boolean]

Constant Summary collapse

NAME_LIMIT =
100
TEXT_LIMIT =
5000
URL_LIMIT =
255

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.entity_parametersObject



44
45
46
# File 'app/models/testimonial.rb', line 44

def self.entity_parameters
  %i[date image language_id name priority text url visible]
end

Instance Method Details

#editable_by?(user) ⇒ Boolean

Parameters:

  • user (User)

Returns:

  • (Boolean)


49
50
51
52
53
# File 'app/models/testimonial.rb', line 49

def editable_by?(user)
  return false if user.nil?

  Biovision::Components::TestimonialsComponent.allow?(user)
end