acts_as_graph_object 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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)
|