mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-08 22:14:04 +08:00
init project
This commit is contained in:
15
app/models/concerns/projectable.rb
Normal file
15
app/models/concerns/projectable.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module Projectable
|
||||
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?
|
||||
}
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user