Finalize check fields
This commit is contained in:
parent
63fc206c27
commit
174cf9f503
12 changed files with 73 additions and 34 deletions
11
app/models/concerns/filter_scopeable.rb
Normal file
11
app/models/concerns/filter_scopeable.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
module FilterScopeable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def filter_scope(name, block)
|
||||
define_method(name) do |filter_value|
|
||||
return self if filter_value.blank?
|
||||
|
||||
instance_exec(filter_value, &block)
|
||||
end
|
||||
end
|
||||
en
|
||||
|
|
@ -6,7 +6,7 @@ class Link < ApplicationRecord
|
|||
belongs_to :link_category
|
||||
has_and_belongs_to_many :checks
|
||||
|
||||
has_rich_text :description_html
|
||||
has_rich_text :description
|
||||
|
||||
validates :url, :text, presence: true
|
||||
validate :check_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue