Skip to content
Snippets Groups Projects
Commit 763304f8 authored by Giovanne Marcelo's avatar Giovanne Marcelo
Browse files

remove ActsAsTaggableOn relations

parent 2c106698
No related branches found
No related tags found
No related merge requests found
......@@ -41,18 +41,16 @@ class Collection < ActiveRecord::Base
scope :from_user, ->(user) { where(owner: user) }
acts_as_taggable
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author], callbacks: :async
def search_data
{
name: name,
description: description,
privacy: privacy,
owner: owner.name,
score: score,
created_at: created_at,
name: name,
description: description,
privacy: privacy,
owner: owner.name,
score: score,
created_at: created_at,
}
end
......
......@@ -54,8 +54,6 @@ class LearningObject < ActiveRecord::Base
default_scope { includes(:object_type, :attachment, :attachments).order(score: :desc) }
scope :missing_thumbnail, ->() { where(thumbnail_file_name: nil) }
acts_as_taggable
searchkick language: 'brazilian', match: :word_start, searchable: [:name, :description, :author, :object_type], callbacks: :async
def search_data
......
......@@ -71,14 +71,12 @@ class User < ActiveRecord::Base
validates_attachment_content_type :avatar, content_type: /\Aimage\/.*\Z/
validates :terms_of_service, acceptance: true
acts_as_tagger
searchkick language: 'brazilian', match: :word_start, searchable: [:name], callbacks: :async
def search_data
{
name: name,
score: score
name: name,
score: score
}
end
......@@ -117,6 +115,7 @@ class User < ActiveRecord::Base
def following?(followable)
!follows.where(followable_id: followable.id, followable_type: followable.class.name).blank?
end
# ~~~~ end followable actions ~~~~ #
private
......@@ -138,12 +137,12 @@ class User < ActiveRecord::Base
unless user
user = User.create(
name: data['name'],
email: user_email,
provider: access_token.provider,
uid: access_token.uid,
password: Devise.friendly_token[0,20]
)
name: data['name'],
email: user_email,
provider: access_token.provider,
uid: access_token.uid,
password: Devise.friendly_token[0, 20]
)
end
user
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment