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 --- db/migrate/20090201211159_create_flags.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20090201211159_create_flags.rb (limited to 'db/migrate/20090201211159_create_flags.rb') diff --git a/db/migrate/20090201211159_create_flags.rb b/db/migrate/20090201211159_create_flags.rb new file mode 100644 index 00000000..3b9da430 --- /dev/null +++ b/db/migrate/20090201211159_create_flags.rb @@ -0,0 +1,13 @@ +class CreateFlags < ActiveRecord::Migration + def self.up + create_table :flags do |t| + t.string :name + + t.timestamps + end + end + + def self.down + drop_table :flags + end +end -- cgit v1.3