rqueensen/faludi-lca-app

View on GitHub
app/models/project.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Project < ApplicationRecord
    has_many :models
    
    validates_uniqueness_of :title, :on => :create
    
    def self.find_project(title)
        # This is very unsafe and need to add salt to it. 
        return Project.where('title LIKE :query', query: "%#{title}%").first
    end
    
end