From 7a5555b1ac542e5fd5680cefaba3574677ecaa46 Mon Sep 17 00:00:00 2001 From: hukl Date: Mon, 2 Feb 2009 00:22:54 +0100 Subject: aggregation spike with flags associated to pages Page has now a named_scope :with_flags which accepts an array of flag names and returns corresponding pages. Can be chained with order and limit --- app/models/flag.rb | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 app/models/flag.rb (limited to 'app/models/flag.rb') diff --git a/app/models/flag.rb b/app/models/flag.rb new file mode 100644 index 0000000..6d67377 --- /dev/null +++ b/app/models/flag.rb @@ -0,0 +1,3 @@ +class Flag < ActiveRecord::Base + has_and_belongs_to_many :pages +end -- cgit v1.3