Skip to content

Commit

Permalink
Modified controller and model
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal committed Jan 9, 2018
1 parent 1b3faa3 commit a53fcc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/tag_controller.rb
Expand Up @@ -115,7 +115,7 @@ def show_for_author
@wildcard = true
end
@tagname = params[:id]
@user = DrupalUser.find_by(name: params[:author])
@user = User.find_by(name: params[:author])
@title = "'" + @tagname.to_s + "' by " + params[:author]
@notes = Tag.tagged_nodes_by_author(@tagname, @user)
@unpaginated = true
Expand Down
1 change: 1 addition & 0 deletions app/models/tag.rb
Expand Up @@ -238,6 +238,7 @@ def self.trending(limit = 5 , start_date = DateTime.now - 1.month , end_date = D
#select nodes by tagname and user_id
def self.tagged_nodes_by_author(tagname, user_id)
if tagname[-1..-1] == '*'
@wildcard = true
Node.where('term_data.name LIKE(?)', tagname[0..-2]+'%')
.includes(:node_tag, :tag)
.references(:term_data)
Expand Down

0 comments on commit a53fcc7

Please sign in to comment.