diff --git a/lib/clortho.rb b/lib/clortho.rb index d2c0dac..75478b9 100644 --- a/lib/clortho.rb +++ b/lib/clortho.rb @@ -25,6 +25,9 @@ def searchable(*args) class_eval <<-CODE class << self + def search_#{arg}_keywords_for(keyword) + true + end end CODE end diff --git a/test/test_clortho.rb b/test/test_clortho.rb index a0741e9..5bd6057 100644 --- a/test/test_clortho.rb +++ b/test/test_clortho.rb @@ -43,6 +43,10 @@ def setup assert_equal "Hello world", @fridge.about_keywords end + should 'have a search_about_keywords_for field' do + assert_equal Post.search_about_keywords_for('lipsum'), true + end + private def save_posts @posts.each{ |post| post.save }