meta_manager 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,8 +6,16 @@ Enable meta tags in your model
6
6
 
7
7
  gem "meta_manager"
8
8
 
9
+ ActiveRecord:
10
+
11
+ require 'meta_manager/orm/active_record'
12
+
9
13
  rake meta_manager_engine:install:migrations
10
14
 
15
+ Mongoid:
16
+
17
+ require 'meta_manager/orm/mongoid'
18
+
11
19
  == Usage
12
20
 
13
21
  class Category < ActiveRecord::Base
@@ -90,4 +98,4 @@ Action show:
90
98
 
91
99
  rake test
92
100
 
93
- Copyright (c) 2011 Aimbulance, released under the MIT license
101
+ Copyright (c) 2012 Fodojo, released under the MIT license
data/lib/meta_manager.rb CHANGED
@@ -1,7 +1,10 @@
1
- require 'meta_manager/taggable'
2
- require 'meta_manager/helper'
1
+ require 'active_support/concern'
2
+ require 'orm_adapter'
3
3
 
4
4
  module MetaManager
5
+ autoload :Taggable, "meta_manager/taggable"
6
+ autoload :Helper, "meta_manager/helper"
7
+ autoload :Model, "meta_manager/model"
5
8
  end
6
9
 
7
10
  require 'meta_manager/engine'
@@ -0,0 +1,27 @@
1
+ module MetaManager
2
+ module Model
3
+ extend ::ActiveSupport::Concern
4
+
5
+ included do
6
+ validates_presence_of :name, :taggable_type, :content
7
+ validates_uniqueness_of :name, :scope => [:taggable_type, :taggable_id, :is_dynamic]
8
+
9
+ attr_accessible :name, :content, :is_dynamic
10
+ end
11
+
12
+ def get_content(controller=nil)
13
+ self.is_dynamic ? dynamic_content(controller) : self.content
14
+ end
15
+
16
+ def dynamic_content(controller)
17
+ self.content.gsub /%{([\w\.]+)}/ do
18
+ items = $1.split('.')
19
+ instance_name = items.shift
20
+ method_name = items.join('.')
21
+ record = controller.instance_variable_get("@#{instance_name}")
22
+
23
+ record.try(:"#{method_name}")
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,8 @@
1
+ class MetaTag < ::ActiveRecord::Base
2
+ include MetaManager::Model
3
+
4
+ belongs_to :taggable, :polymorphic => true
5
+
6
+ validates_presence_of :name, :taggable_type, :content
7
+ validates_uniqueness_of :name, :scope => [:taggable_type, :taggable_id, :is_dynamic]
8
+ end
@@ -0,0 +1,16 @@
1
+ require 'mongoid'
2
+
3
+ class MetaTag
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+ include MetaManager::Model
7
+
8
+ # Columns
9
+ field :name, :type => String
10
+ field :content, :type => String
11
+ field :is_dynamic, :type => Boolean
12
+
13
+ index({:name => 1})
14
+
15
+ belongs_to :taggable, :polymorphic => true, :index => true
16
+ end
@@ -0,0 +1,2 @@
1
+ require 'orm_adapter/adapters/active_record'
2
+ require 'meta_manager/models/active_record/meta_tag'
@@ -0,0 +1,2 @@
1
+ require 'orm_adapter/adapters/mongoid'
2
+ require 'meta_manager/models/mongoid/meta_tag
@@ -1,3 +1,3 @@
1
1
  module MetaManager
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
6
+ pool: 5
7
+ timeout: 5000
8
+
9
+ # Warning: The database defined as "test" will be erased and
10
+ # re-generated from your development database when you run "rake".
11
+ # Do not set this db to the same as development or production.
12
+ test:
13
+ adapter: sqlite3
14
+ database: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,2 @@
1
+ # Load ORM
2
+ require 'meta_manager/orm/active_record'
Binary file
@@ -0,0 +1,241 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+ Connecting to database specified by database.yml
4
+  (0.2ms) select sqlite_version(*)
5
+  (9.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
6
+  (0.1ms) PRAGMA index_list("schema_migrations")
7
+  (3.5ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
8
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
9
+ Migrating to CreateMetaTags (20120105114018)
10
+  (0.1ms) begin transaction
11
+  (0.8ms) CREATE TABLE "meta_tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(50) NOT NULL, "content" text, "is_dynamic" boolean DEFAULT 'f', "taggable_id" integer NOT NULL, "taggable_type" varchar(50) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
12
+  (0.1ms) PRAGMA index_list("meta_tags")
13
+  (0.2ms) CREATE INDEX "index_meta_tags_on_name" ON "meta_tags" ("name")
14
+  (0.1ms) PRAGMA index_list("meta_tags")
15
+  (0.1ms) PRAGMA index_info('index_meta_tags_on_name')
16
+  (0.2ms) CREATE INDEX "index_meta_tags_on_taggable_type_and_taggable_id" ON "meta_tags" ("taggable_type", "taggable_id")
17
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20120105114018')
18
+  (4.7ms) commit transaction
19
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
20
+ Migrating to CreateCategories (20111226131910)
21
+  (0.1ms) begin transaction
22
+  (1.1ms) CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
23
+  (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111226131910')
24
+  (6.0ms) commit transaction
25
+ Migrating to CreatePosts (20111226131911)
26
+  (0.1ms) begin transaction
27
+  (0.5ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "content" text, "notes" varchar(255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
28
+  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111226131911')
29
+  (12.5ms) commit transaction
30
+  (0.1ms) begin transaction
31
+  (0.1ms) rollback transaction
32
+  (0.1ms) begin transaction
33
+  (0.1ms) SAVEPOINT active_record_1
34
+ MetaTag Exists (0.3ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
35
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
36
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
37
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
38
+ SQL (1.8ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
39
+ SQL (0.5ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
40
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "keywords content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "keywords"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
41
+  (0.1ms) RELEASE SAVEPOINT active_record_1
42
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
43
+  (0.3ms) rollback transaction
44
+  (0.1ms) begin transaction
45
+  (0.0ms) SAVEPOINT active_record_1
46
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
47
+  (0.1ms) RELEASE SAVEPOINT active_record_1
48
+ Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = ? LIMIT 1 [["id", 1]]
49
+  (0.2ms) SELECT COUNT(*) FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
50
+ MetaTag Load (0.1ms) SELECT "meta_tags".* FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
51
+  (0.2ms) rollback transaction
52
+  (0.1ms) begin transaction
53
+  (0.1ms) rollback transaction
54
+  (0.0ms) begin transaction
55
+  (0.1ms) SELECT COUNT(*) FROM "meta_tags" 
56
+  (0.0ms) SAVEPOINT active_record_1
57
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
58
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
59
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
60
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
61
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62
+  (0.1ms) SELECT COUNT(*) FROM "meta_tags"
63
+  (0.2ms) rollback transaction
64
+  (0.0ms) begin transaction
65
+  (0.1ms) rollback transaction
66
+  (0.1ms) begin transaction
67
+  (0.1ms) rollback transaction
68
+  (0.0ms) begin transaction
69
+  (0.0ms) rollback transaction
70
+  (0.1ms) begin transaction
71
+  (0.0ms) SAVEPOINT active_record_1
72
+ SQL (0.7ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "some content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "test"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
73
+  (0.1ms) RELEASE SAVEPOINT active_record_1
74
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 't') LIMIT 1
75
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 't') LIMIT 1
76
+  (0.2ms) rollback transaction
77
+  (0.1ms) begin transaction
78
+  (0.0ms) SAVEPOINT active_record_1
79
+ SQL (0.7ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "some content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "test"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
80
+  (0.1ms) RELEASE SAVEPOINT active_record_1
81
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 2 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
82
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 2 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
83
+  (0.2ms) rollback transaction
84
+  (0.1ms) begin transaction
85
+  (0.0ms) SAVEPOINT active_record_1
86
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'somename' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
87
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'somename' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
88
+ SQL (0.4ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "some content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "somename"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
89
+  (0.1ms) RELEASE SAVEPOINT active_record_1
90
+  (0.3ms) rollback transaction
91
+  (0.0ms) begin transaction
92
+ MetaTag Exists (0.3ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" IS NULL AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
93
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" IS NULL AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
94
+  (0.1ms) rollback transaction
95
+  (0.1ms) begin transaction
96
+  (0.0ms) SAVEPOINT active_record_1
97
+ SQL (0.5ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "some content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "test"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
98
+  (0.1ms) RELEASE SAVEPOINT active_record_1
99
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
100
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'test' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
101
+  (0.2ms) rollback transaction
102
+  (0.1ms) begin transaction
103
+  (0.0ms) SAVEPOINT active_record_1
104
+ SQL (0.5ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "some content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "somename"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
105
+  (0.1ms) RELEASE SAVEPOINT active_record_1
106
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'somename' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 't') LIMIT 1
107
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'somename' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" = 1 AND "meta_tags"."is_dynamic" = 't') LIMIT 1
108
+  (0.2ms) rollback transaction
109
+  (0.1ms) begin transaction
110
+  (0.0ms) rollback transaction
111
+  (0.0ms) begin transaction
112
+  (0.0ms) rollback transaction
113
+  (0.1ms) begin transaction
114
+  (0.1ms) SAVEPOINT active_record_1
115
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
116
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
117
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
118
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
119
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
120
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
121
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
122
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
123
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
124
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
125
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
126
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
127
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
128
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
129
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test, keywords"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "keywords"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
130
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test description"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "description"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
131
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "category og:title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
132
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title %{post.title}, content %{post.content}, notes %{post.notes}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
133
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "dynamic og:title - %{post.title}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
134
+  (0.1ms) RELEASE SAVEPOINT active_record_1
135
+  (0.1ms) SAVEPOINT active_record_1
136
+ SQL (0.6ms) INSERT INTO "posts" ("content", "created_at", "notes", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["content", "test_content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["notes", "test_notes"], ["title", "test_title"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
137
+  (0.1ms) RELEASE SAVEPOINT active_record_1
138
+ Processing by PostsController#index as HTML
139
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" LIMIT 1
140
+ Rendered posts/index.html.erb within layouts/application (3.0ms)
141
+ MetaTag Load (0.3ms) SELECT "meta_tags".* FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
142
+ Completed 200 OK in 106ms (Views: 103.7ms | ActiveRecord: 0.5ms)
143
+  (0.3ms) rollback transaction
144
+  (0.1ms) begin transaction
145
+  (0.1ms) SAVEPOINT active_record_1
146
+ MetaTag Exists (0.3ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
147
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
148
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
149
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
150
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
151
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
152
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
153
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
154
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
155
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
156
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
157
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
158
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
159
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
160
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test, keywords"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "keywords"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
161
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test description"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "description"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
162
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "category og:title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
163
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title %{post.title}, content %{post.content}, notes %{post.notes}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
164
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "dynamic og:title - %{post.title}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
165
+  (0.1ms) RELEASE SAVEPOINT active_record_1
166
+  (0.1ms) SAVEPOINT active_record_1
167
+ SQL (0.4ms) INSERT INTO "posts" ("content", "created_at", "notes", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["content", "test_content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["notes", "test_notes"], ["title", "test_title"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
168
+  (0.1ms) RELEASE SAVEPOINT active_record_1
169
+ Processing by PostsController#show as HTML
170
+ Parameters: {"id"=>"1"}
171
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" LIMIT 1
172
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", "1"]]
173
+ MetaTag Load (0.3ms) SELECT "meta_tags".* FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
174
+ Completed 200 OK in 8ms (Views: 4.7ms | ActiveRecord: 0.6ms)
175
+  (0.3ms) rollback transaction
176
+  (0.1ms) begin transaction
177
+  (0.1ms) SAVEPOINT active_record_1
178
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
179
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
180
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
181
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
182
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
183
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
184
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
185
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
186
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
187
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
188
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
189
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
190
+ SQL (0.5ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
191
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
192
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test, keywords"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "keywords"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
193
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test description"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "description"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
194
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "category og:title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
195
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title %{post.title}, content %{post.content}, notes %{post.notes}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
196
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "dynamic og:title - %{post.title}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
197
+  (0.1ms) RELEASE SAVEPOINT active_record_1
198
+  (0.1ms) SAVEPOINT active_record_1
199
+ SQL (0.4ms) INSERT INTO "posts" ("content", "created_at", "notes", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["content", "test_content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["notes", "test_notes"], ["title", "test_title"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
200
+  (0.1ms) RELEASE SAVEPOINT active_record_1
201
+ Processing by PostsController#show as HTML
202
+ Parameters: {"id"=>"1"}
203
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" LIMIT 1
204
+ Post Load (0.1ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = ? LIMIT 1 [["id", "1"]]
205
+ MetaTag Load (0.2ms) SELECT "meta_tags".* FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
206
+ Completed 200 OK in 5ms (Views: 3.0ms | ActiveRecord: 0.5ms)
207
+  (0.3ms) rollback transaction
208
+  (0.1ms) begin transaction
209
+  (0.1ms) SAVEPOINT active_record_1
210
+ MetaTag Exists (0.2ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
211
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
212
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
213
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'keywords' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
214
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
215
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'description' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
216
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
217
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 'f') LIMIT 1
218
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
219
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
220
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
221
+ MetaTag Exists (0.1ms) SELECT 1 AS one FROM "meta_tags" WHERE ("meta_tags"."name" = 'og:title' AND "meta_tags"."taggable_type" = 'Category' AND "meta_tags"."taggable_id" IS NULL AND "meta_tags"."is_dynamic" = 't') LIMIT 1
222
+ SQL (0.4ms) INSERT INTO "categories" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["title", "Test category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
223
+ SQL (0.3ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
224
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test, keywords"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "keywords"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
225
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "test description"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "description"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
226
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "category og:title"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", false], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
227
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "title %{post.title}, content %{post.content}, notes %{post.notes}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
228
+ SQL (0.2ms) INSERT INTO "meta_tags" ("content", "created_at", "is_dynamic", "name", "taggable_id", "taggable_type", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["content", "dynamic og:title - %{post.title}"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["is_dynamic", true], ["name", "og:title"], ["taggable_id", 1], ["taggable_type", "Category"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
229
+  (0.1ms) RELEASE SAVEPOINT active_record_1
230
+  (0.0ms) SAVEPOINT active_record_1
231
+ SQL (0.4ms) INSERT INTO "posts" ("content", "created_at", "notes", "title", "updated_at") VALUES (?, ?, ?, ?, ?) [["content", "test_content"], ["created_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00], ["notes", "test_notes"], ["title", "test_title"], ["updated_at", Sat, 05 Jan 2013 21:59:37 UTC +00:00]]
232
+  (0.1ms) RELEASE SAVEPOINT active_record_1
233
+ Processing by PostsController#index as HTML
234
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" LIMIT 1
235
+ MetaTag Load (0.2ms) SELECT "meta_tags".* FROM "meta_tags" WHERE "meta_tags"."taggable_id" = 1 AND "meta_tags"."taggable_type" = 'Category'
236
+ Completed 200 OK in 5ms (Views: 3.2ms | ActiveRecord: 0.4ms)
237
+  (0.3ms) rollback transaction
238
+  (0.1ms) begin transaction
239
+ Processing by WelcomeController#index as HTML
240
+ Completed 200 OK in 4ms (Views: 3.7ms | ActiveRecord: 0.0ms)
241
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,16 +9,16 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-16 00:00:00.000000000 Z
12
+ date: 2013-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: activerecord
15
+ name: orm_adapter
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.1.3
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,39 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.3
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: activerecord
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 3.0.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 3.0.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: mongoid
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
30
62
  - !ruby/object:Gem::Dependency
31
63
  name: sqlite3
32
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,21 +98,27 @@ executables: []
66
98
  extensions: []
67
99
  extra_rdoc_files: []
68
100
  files:
69
- - app/models/meta_tag.rb
70
101
  - db/migrate/20120105114018_create_meta_tags.rb
71
102
  - lib/meta_manager/version.rb
72
103
  - lib/meta_manager/engine.rb
73
104
  - lib/meta_manager/helper.rb
74
105
  - lib/meta_manager/taggable.rb
106
+ - lib/meta_manager/models/mongoid/meta_tag.rb
107
+ - lib/meta_manager/models/active_record/meta_tag.rb
108
+ - lib/meta_manager/model.rb
109
+ - lib/meta_manager/orm/mongoid.rb
110
+ - lib/meta_manager/orm/active_record.rb
75
111
  - lib/meta_manager.rb
76
112
  - lib/tasks/meta_manager_tasks.rake
77
113
  - MIT-LICENSE
78
114
  - Rakefile
79
115
  - README.rdoc
80
116
  - test/meta_manager_test.rb
117
+ - test/dummy/db/test.sqlite3
81
118
  - test/dummy/db/migrate/20111226131910_create_categories.rb
82
119
  - test/dummy/db/migrate/20111226131911_create_posts.rb
83
120
  - test/dummy/config.ru
121
+ - test/dummy/log/test.log
84
122
  - test/dummy/app/assets/stylesheets/application.css
85
123
  - test/dummy/app/assets/javascripts/application.js
86
124
  - test/dummy/app/helpers/application_helper.rb
@@ -101,8 +139,10 @@ files:
101
139
  - test/dummy/config/environments/development.rb
102
140
  - test/dummy/config/environments/production.rb
103
141
  - test/dummy/config/environments/test.rb
142
+ - test/dummy/config/database.yml
104
143
  - test/dummy/config/initializers/inflections.rb
105
144
  - test/dummy/config/initializers/secret_token.rb
145
+ - test/dummy/config/initializers/meta_manager.rb
106
146
  - test/dummy/config/initializers/wrap_parameters.rb
107
147
  - test/dummy/config/initializers/mime_types.rb
108
148
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -144,9 +184,11 @@ specification_version: 3
144
184
  summary: Head meta tags manager for models.
145
185
  test_files:
146
186
  - test/meta_manager_test.rb
187
+ - test/dummy/db/test.sqlite3
147
188
  - test/dummy/db/migrate/20111226131910_create_categories.rb
148
189
  - test/dummy/db/migrate/20111226131911_create_posts.rb
149
190
  - test/dummy/config.ru
191
+ - test/dummy/log/test.log
150
192
  - test/dummy/app/assets/stylesheets/application.css
151
193
  - test/dummy/app/assets/javascripts/application.js
152
194
  - test/dummy/app/helpers/application_helper.rb
@@ -167,8 +209,10 @@ test_files:
167
209
  - test/dummy/config/environments/development.rb
168
210
  - test/dummy/config/environments/production.rb
169
211
  - test/dummy/config/environments/test.rb
212
+ - test/dummy/config/database.yml
170
213
  - test/dummy/config/initializers/inflections.rb
171
214
  - test/dummy/config/initializers/secret_token.rb
215
+ - test/dummy/config/initializers/meta_manager.rb
172
216
  - test/dummy/config/initializers/wrap_parameters.rb
173
217
  - test/dummy/config/initializers/mime_types.rb
174
218
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -1,23 +0,0 @@
1
- class MetaTag < ::ActiveRecord::Base
2
- belongs_to :taggable, :polymorphic => true
3
-
4
- validates_presence_of :name, :taggable_type, :content
5
- validates_uniqueness_of :name, :scope => [:taggable_type, :taggable_id, :is_dynamic]
6
-
7
- attr_accessible :name, :content, :is_dynamic
8
-
9
- def get_content(controller=nil)
10
- self.is_dynamic ? dynamic_content(controller) : self.content
11
- end
12
-
13
- def dynamic_content(controller)
14
- self.content.gsub /%{([\w\.]+)}/ do
15
- items = $1.split('.')
16
- instance_name = items.shift
17
- method_name = items.join('.')
18
- record = controller.instance_variable_get("@#{instance_name}")
19
-
20
- record.try(:"#{method_name}")
21
- end
22
- end
23
- end