acts_as_graph_object 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ module ActsAsGraphObject
|
|
26
26
|
# standard object properties & alternative names
|
27
27
|
default_properties = {
|
28
28
|
:title => [:name, :label],
|
29
|
-
:type => [:kind, :group
|
29
|
+
:type => [:kind, :group],
|
30
30
|
:image => [:picture, :photo],
|
31
31
|
:url => [:permalink, :link],
|
32
32
|
:description => [:info, :details],
|
@@ -1,12 +1,11 @@
|
|
1
1
|
module ActsAsGraphObject
|
2
2
|
module ViewHelpers
|
3
|
-
def graph_object_tags_for(object,
|
3
|
+
def graph_object_tags_for(object, overrides = {})
|
4
4
|
raise "You need to add acts_as_graph_object to your #{object.class} model." unless object.respond_to?(:graph_properties)
|
5
5
|
meta_tags = []
|
6
|
-
|
6
|
+
# go through each namespace: :fb, :og & custom..
|
7
|
+
object.graph_properties.deep_merge(:og => overrides).each do |namespace, attributes|
|
7
8
|
attributes.each do |property, values|
|
8
|
-
# allow value overide from view..
|
9
|
-
values = options[property] || values
|
10
9
|
# in most cases 'values' will be a single value
|
11
10
|
Array(values).each do |content|
|
12
11
|
meta_tags << tag(:meta, :property => [namespace, property].join(':'), :content => content)
|