Skip to content

Commit

Permalink
LogSaver: Keyword プラグインとの連携
Browse files Browse the repository at this point in the history
issue: #68

データベースの設定
  • Loading branch information
koi-chan committed Mar 29, 2016
1 parent 078ee0a commit 1528938
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/rgrb/plugin/log_saver/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ class Channel
property :enable, Boolean, default: false
end

# キーワード抽出
class Keyword
include DataMapper::Resource

storage_names[:default] = 'keywords'
DataMapper::Property::String.length(512)
DataMapper::Property.required(true)

property :id, Serial
property :log, Integer
property :word, String
end

def self.call(model_name)
@table_prefix + DataMapper::NamingConventions::Resource::UnderscoredAndPluralizedWithoutModule.call(model_name) + @table_suffix
end
Expand Down

0 comments on commit 1528938

Please sign in to comment.