You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/models/concerns/projectable.rb

16 lines
361 B

module Projectable
5 years ago
extend ActiveSupport::Concern
included do
has_many :projects, -> { order(position: :asc) }
scope :without_content, -> { select(column_names - ['content'])}
scope :search, lambda { |keywords|
where("name LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
}
5 years ago
end
module ClassMethods
end
end