app/models/lesli_babel/string.rb in lesli_babel-0.1.0 vs app/models/lesli_babel/string.rb in lesli_babel-0.2.0

- old
+ new

@@ -1,12 +1,34 @@ module LesliBabel class String < ApplicationRecord - belongs_to :user belongs_to :bucket before_create :clean_label_string +=begin + enum prefix: { + # database + # controllers + # models + # views + # components + # elements + column + enum + + message + + navigation + toolbar + + button + chart + title + form + } +=end + def self.index(current_user, query, params) strings = TranslationsService.strings(params[:module], params[:bucket]) # if search string was sent @@ -213,13 +235,9 @@ .gsub(/[^0-9A-Za-z\s\-\_]/, '') # remove special characters from string .gsub(/-/, '_') # replace dashes with underscore .gsub(/\s+/, '_') # replace spaces or spaces with single dash self.status = "normal" if self.status.blank? - self.priority = "normal" if self.priority.blank? - - self.reference_module_bucket = "#{self.bucket.reference_module}-#{self.bucket.name}" - + self.reference_bucket = "#{self.bucket.reference_module}-#{self.bucket.name}" end - end end