Module: ActiveFedora::RelationshipsHelper
- Extended by:
- ActiveSupport::Concern
- Included in:
- Base
- Defined in:
- lib/active_fedora/relationships_helper.rb
Overview
This module is meant to extend semantic node to add functionality based on a relationship’s name It is meant to turn a relationship into just another attribute in a model. The notion of a “relationship name” is used internally to distinguish between the relationships you’ve set up using has_relationship and the implicit relationships that are based on the predicates themselves.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#add_named_relationship(name, object) ⇒ Object
deprecated
Deprecated.
Please use #add_relationship_by_name instead.
-
#add_relationship_by_name(name, object) ⇒ Boolean
** EXPERIMENTAL **.
-
#assert_conforms_to(name, object, model_class) ⇒ Object
** EXPERIMENTAL **.
-
#assert_kind_of_model(name, object, model_class) ⇒ Object
deprecated
Deprecated.
Please use #assert_conforms_to instead.
-
#class_from_name(name) ⇒ Class
Returns a Class symbol for the given string for the class name.
-
#conforms_to?(model_class) ⇒ Boolean
** EXPERIMENTAL **.
-
#find_relationship_by_name(name) ⇒ Array
** EXPERIMENTAL **.
-
#inbound_named_relationship_predicates ⇒ Object
deprecated
Deprecated.
Please use #inbound_relationship_predicates instead.
-
#inbound_relationship_names ⇒ Array
** EXPERIMENTAL **.
-
#inbound_relationship_predicates ⇒ Hash
** EXPERIMENTAL **.
-
#inbound_relationships_by_name ⇒ Hash
** EXPERIMENTAL **.
-
#is_named_relationship?(name, outbound_only = true) ⇒ Boolean
deprecated
Deprecated.
Please use #is_relationship_name? instead.
-
#is_relationship_name?(name, outbound_only = true) ⇒ Boolean
** EXPERIMENTAL **.
-
#kind_of_model?(model_class) ⇒ Boolean
deprecated
Deprecated.
Please use #conforms_to? instead.
-
#named_inbound_relationships ⇒ Object
deprecated
Deprecated.
Please use #inbound_relationships_by_name instead.
-
#named_outbound_relationships ⇒ Object
deprecated
Deprecated.
Please use #outbound_relationships_by_name instead.
-
#named_relationship(name) ⇒ Object
deprecated
Deprecated.
Please use #find_relationship_by_name instead.
-
#named_relationship_predicates ⇒ Object
deprecated
Deprecated.
Please use #relationship_predicates instead.
-
#named_relationship_predicates_from_class ⇒ Object
deprecated
Deprecated.
Please use #relationship_predicates_from_class instead.
-
#named_relationship_query(relationship_name) ⇒ Object
deprecated
Deprecated.
Please use #relationship_query instead.
-
#named_relationship_type(name) ⇒ Object
deprecated
Deprecated.
Please use #relationship_model_type instead.
-
#named_relationships(outbound_only = true) ⇒ Object
deprecated
Deprecated.
Please use #relationships_by_name instead.
-
#named_relationships_desc ⇒ Object
deprecated
Deprecated.
Please use #relationships_desc instead.
-
#named_relationships_desc_from_class ⇒ Object
deprecated
Deprecated.
Please use #relationships_desc_from_class instead.
-
#named_relationships_from_class ⇒ Object
deprecated
Deprecated.
Please use #relationships_by_name_from_class instead.
-
#outbound_named_relationship_predicates ⇒ Object
deprecated
Deprecated.
Please use #outbound_relationship_predicates instead.
-
#outbound_relationship_names ⇒ Array
** EXPERIMENTAL **.
-
#outbound_relationship_predicates ⇒ Hash
** EXPERIMENTAL **.
-
#outbound_relationships_by_name ⇒ Hash
** EXPERIMENTAL **.
-
#register_named_relationship(subject, name, predicate, opts) ⇒ Object
deprecated
Deprecated.
Please use #register_relationship_desc instead.
-
#register_named_subject(subject) ⇒ Object
deprecated
Deprecated.
Please use #register_relationship_desc_subject instead.
-
#register_relationship_desc(subject, name, predicate, opts = {}) ⇒ Object
** EXPERIMENTAL **.
-
#register_relationship_desc_subject(subject) ⇒ Object
Internal method that ensures a relationship subject such as :self and :inbound exist within the relationships_desc hash tracking relationships metadata.
-
#relationship_model_type(name) ⇒ Class
** EXPERIMENTAL **.
-
#relationship_names ⇒ Array
** EXPERIMENTAL **.
-
#relationship_predicates ⇒ Hash
** EXPERIMENTAL **.
-
#relationship_predicates_from_class ⇒ Hash
** EXPERIMENTAL **.
-
#relationship_query(relationship_name) ⇒ String
Call this method to return the query used against solr to retrieve any objects linked via the relationship name given.
-
#relationships_by_name(outbound_only = true) ⇒ Hash
** EXPERIMENTAL **.
-
#relationships_by_name_from_class ⇒ Hash
** EXPERIMENTAL **.
-
#relationships_desc ⇒ Hash
** EXPERIMENTAL **.
-
#relationships_desc_from_class ⇒ Hash
** EXPERIMENTAL **.
-
#remove_named_relationship(name, object) ⇒ Object
deprecated
Deprecated.
Please use #remove_relationship_by_name instead.
-
#remove_relationship_by_name(name, object) ⇒ Boolean
** EXPERIMENTAL **.
Instance Method Details
#add_named_relationship(name, object) ⇒ Object
Please use #add_relationship_by_name instead.
525 526 527 528 |
# File 'lib/active_fedora/relationships_helper.rb', line 525 def add_named_relationship(name,object) logger.warn("Deprecation: add_named_relationship has been deprecated. Please call add_relationship_by_name instead.") add_relationship_by_name(name,object) end |
#add_relationship_by_name(name, object) ⇒ Boolean
** EXPERIMENTAL **
Add an outbound relationship for given relationship name See ActiveFedora::SemanticNode::ClassMethods.has_relationship
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/active_fedora/relationships_helper.rb', line 275 def add_relationship_by_name(name, object) if is_relationship_name?(name,true) if relationships_desc[:self][name].has_key?(:type) klass = class_from_name(relationships_desc[:self][name][:type]) unless klass.nil? (assert_conforms_to 'object', object, klass) end end #r = ActiveFedora::Relationship.new({:subject=>:self,:predicate=>outbound_relationship_predicates[name],:object=>object}) #add_relationship(r) add_relationship(outbound_relationship_predicates[name],object) else false end end |
#assert_conforms_to(name, object, model_class) ⇒ Object
** EXPERIMENTAL **
Throws an assertion error if conforms_to? returns false for object and model_class
311 312 313 |
# File 'lib/active_fedora/relationships_helper.rb', line 311 def assert_conforms_to(name, object, model_class) raise "Assertion failure: #{name}: #{object.pid} does not have model #{model_class}, it has model #{relationships[:self][:has_model]}" unless object.conforms_to?(model_class) end |
#assert_kind_of_model(name, object, model_class) ⇒ Object
Please use #assert_conforms_to instead.
537 538 539 540 |
# File 'lib/active_fedora/relationships_helper.rb', line 537 def assert_kind_of_model(name,object,model_class) logger.warn("Deprecation: assert_kind_of_model has been deprecated. Please call assert_conforms_to instead.") assert_conforms_to(name,object,model_class) end |
#class_from_name(name) ⇒ Class
Returns a Class symbol for the given string for the class name
347 348 349 350 351 |
# File 'lib/active_fedora/relationships_helper.rb', line 347 def class_from_name(name) klass = name.to_s.split('::').inject(Kernel) {|scope, const_name| scope.const_get(const_name)} (!klass.nil? && klass.is_a?(::Class)) ? klass : nil end |
#conforms_to?(model_class) ⇒ Boolean
** EXPERIMENTAL **
Checks that this object is matches the model class passed in. It requires two steps to pass to return true
1. It has a hasModel relationship of the same model
2. kind_of? returns true for the model passed in
This method can most often be used to detect if an object from Fedora that was created with a different model was then used to populate this object.
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/active_fedora/relationships_helper.rb', line 325 def conforms_to?(model_class) if self.kind_of?(model_class) #check has model and class match if relationships[:self].has_key?(:has_model) r = ActiveFedora::Relationship.new(:subject=>:self, :predicate=>:has_model, :object=>ActiveFedora::ContentModel.pid_from_ruby_class(self.class)) if relationships[:self][:has_model].first.to_s.eql?(r.object.to_s) return true else raise "has_model relationship check failed for model #{model_class} raising exception, expected: '#{r.object.to_s}' actual: '#{relationships[:self][:has_model].to_s}'" end else raise "has_model relationship does not exist for model #{model_class} check raising exception" end else raise "kind_of? check failed for model #{model_class}, actual #{self.class} raising exception" end return false end |
#find_relationship_by_name(name) ⇒ Array
** EXPERIMENTAL **
Return array of objects for a given relationship name
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/active_fedora/relationships_helper.rb', line 44 def find_relationship_by_name(name) rels = nil if inbound_relationship_names.include?(name) rels = relationships_by_name(false)[:inbound][name] elsif outbound_relationship_names.include?(name) rels = relationships_by_name[:self][name] end rels = [] if rels.nil? return rels end |
#inbound_named_relationship_predicates ⇒ Object
Please use #inbound_relationship_predicates instead.
483 484 485 486 |
# File 'lib/active_fedora/relationships_helper.rb', line 483 def inbound_named_relationship_predicates logger.warn("Deprecation: inbound_named_relationship_predicates has been deprecated. Please call inbound_relationship_predicates instead.") inbound_relationship_predicates end |
#inbound_relationship_names ⇒ Array
** EXPERIMENTAL **
Return array of relationship names for all inbound relationships (coming from other objects’ RELS-EXT and Solr)
197 198 199 |
# File 'lib/active_fedora/relationships_helper.rb', line 197 def inbound_relationship_names relationships_desc.has_key?(:inbound) ? relationships_desc[:inbound].keys : [] end |
#inbound_relationship_predicates ⇒ Hash
** EXPERIMENTAL **
Return hash of inbound relationship names and predicate pairs
151 152 153 |
# File 'lib/active_fedora/relationships_helper.rb', line 151 def inbound_relationship_predicates relationship_predicates.has_key?(:inbound) ? relationship_predicates[:inbound] : {} end |
#inbound_relationships_by_name ⇒ Hash
** EXPERIMENTAL **
Return hash of relationships_by_name defined within other objects’ RELS-EXT It returns a hash of relationship name to arrays of objects. It requeries solr each time this method is called.
125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/active_fedora/relationships_helper.rb', line 125 def inbound_relationships_by_name rels = {} if relationships_desc.has_key?(:inbound)&&!relationships_desc[:inbound].empty?() inbound_rels = inbound_relationships if relationship_predicates.has_key?(:inbound) relationship_predicates[:inbound].each do |name, predicate| rels[name] = inbound_rels.has_key?(predicate) ? inbound_rels[predicate] : [] end end end return rels end |
#is_named_relationship?(name, outbound_only = true) ⇒ Boolean
Please use #is_relationship_name? instead.
501 502 503 504 |
# File 'lib/active_fedora/relationships_helper.rb', line 501 def is_named_relationship?(name, outbound_only=true) logger.warn("Deprecation: is_named_relationship? has been deprecated. Please call is_relationship_name? instead.") is_relationship_name?(name,outbound_only) end |
#is_relationship_name?(name, outbound_only = true) ⇒ Boolean
** EXPERIMENTAL **
Returns true if the given relationship name is a relationship
223 224 225 226 227 228 229 |
# File 'lib/active_fedora/relationships_helper.rb', line 223 def is_relationship_name?(name, outbound_only=true) if outbound_only outbound_relationship_names.include?(name) else (outbound_relationship_names.include?(name)||inbound_relationship_names.include?(name)) end end |
#kind_of_model?(model_class) ⇒ Boolean
Please use #conforms_to? instead.
543 544 545 546 |
# File 'lib/active_fedora/relationships_helper.rb', line 543 def kind_of_model?(model_class) logger.warn("Deprecation: kind_of_model? has been deprecated. Please call conforms_to? instead.") conforms_to?(model_class) end |
#named_inbound_relationships ⇒ Object
Please use #inbound_relationships_by_name instead.
465 466 467 468 |
# File 'lib/active_fedora/relationships_helper.rb', line 465 def named_inbound_relationships logger.warn("Deprecation: named_inbound_relationships has been deprecated. Please call inbound_relationships_by_name instead.") inbound_relationships_by_name end |
#named_outbound_relationships ⇒ Object
Please use #outbound_relationships_by_name instead.
471 472 473 474 |
# File 'lib/active_fedora/relationships_helper.rb', line 471 def named_outbound_relationships logger.warn("Deprecation: named_outbound_relationships has been deprecated. Please call outbound_relationships_by_name instead.") outbound_relationships_by_name end |
#named_relationship(name) ⇒ Object
Please use #find_relationship_by_name instead.
435 436 437 438 |
# File 'lib/active_fedora/relationships_helper.rb', line 435 def named_relationship(name) logger.warn("Deprecation: named_relationship has been deprecated. Please call find_relationship_by_name instead.") find_relationship_by_name(name) end |
#named_relationship_predicates ⇒ Object
Please use #relationship_predicates instead.
489 490 491 492 |
# File 'lib/active_fedora/relationships_helper.rb', line 489 def named_relationship_predicates logger.warn("Deprecation: named_relationship_predicates has been deprecated. Please call relationship_predicates instead.") relationship_predicates end |
#named_relationship_predicates_from_class ⇒ Object
Please use #relationship_predicates_from_class instead.
495 496 497 498 |
# File 'lib/active_fedora/relationships_helper.rb', line 495 def named_relationship_predicates_from_class logger.warn("Deprecation: named_relationship_predicates_from_class has been deprecated. Please call relationship_predicates_from_class instead.") relationship_predicates_from_class end |
#named_relationship_query(relationship_name) ⇒ Object
Please use #relationship_query instead.
549 550 551 552 |
# File 'lib/active_fedora/relationships_helper.rb', line 549 def named_relationship_query(relationship_name) logger.warn("Deprecation: named_relationship_query has been deprecated. Please call relationship_query instead.") relationship_query(relationship_name) end |
#named_relationship_type(name) ⇒ Object
Please use #relationship_model_type instead.
519 520 521 522 |
# File 'lib/active_fedora/relationships_helper.rb', line 519 def named_relationship_type(name) logger.warn("Deprecation: named_relationship_type has been deprecated. Please call relationship_model_type instead.") relationship_model_type(name) end |
#named_relationships(outbound_only = true) ⇒ Object
Please use #relationships_by_name instead.
453 454 455 456 |
# File 'lib/active_fedora/relationships_helper.rb', line 453 def named_relationships(outbound_only=true) logger.warn("Deprecation: named_relationships has been deprecated. Please call relationships_by_name instead.") relationships_by_name(outbound_only) end |
#named_relationships_desc ⇒ Object
Please use #relationships_desc instead.
507 508 509 510 |
# File 'lib/active_fedora/relationships_helper.rb', line 507 def named_relationships_desc logger.warn("Deprecation: named_relationships_desc has been deprecated. Please call relationships_desc instead.") relationships_desc end |
#named_relationships_desc_from_class ⇒ Object
Please use #relationships_desc_from_class instead.
513 514 515 516 |
# File 'lib/active_fedora/relationships_helper.rb', line 513 def named_relationships_desc_from_class logger.warn("Deprecation: named_relationships_desc_from_class has been deprecated. Please call relationships_desc_from_class instead.") relationships_desc_from_class end |
#named_relationships_from_class ⇒ Object
Please use #relationships_by_name_from_class instead.
459 460 461 462 |
# File 'lib/active_fedora/relationships_helper.rb', line 459 def named_relationships_from_class logger.warn("Deprecation: named_relationships_from_class has been deprecated. Please call relationships_by_name_from_class instead.") relationships_by_name_from_class end |
#outbound_named_relationship_predicates ⇒ Object
Please use #outbound_relationship_predicates instead.
477 478 479 480 |
# File 'lib/active_fedora/relationships_helper.rb', line 477 def outbound_named_relationship_predicates logger.warn("Deprecation: outbound_named_relationship_predicates has been deprecated. Please call outbound_relationship_predicates instead.") outbound_relationship_predicates end |
#outbound_relationship_names ⇒ Array
** EXPERIMENTAL **
Return array of relationship names for all outbound relationships (coming from this object’s RELS-EXT)
205 206 207 |
# File 'lib/active_fedora/relationships_helper.rb', line 205 def outbound_relationship_names relationships_desc.has_key?(:self) ? relationships_desc[:self].keys : [] end |
#outbound_relationship_predicates ⇒ Hash
** EXPERIMENTAL **
Return hash of outbound relationship names and predicate pairs
143 144 145 |
# File 'lib/active_fedora/relationships_helper.rb', line 143 def outbound_relationship_predicates relationship_predicates.has_key?(:self) ? relationship_predicates[:self] : {} end |
#outbound_relationships_by_name ⇒ Hash
** EXPERIMENTAL **
Return hash of relationships_by_name defined within this object’s RELS-EXT It returns a hash of relationship name to arrays of objects
214 215 216 |
# File 'lib/active_fedora/relationships_helper.rb', line 214 def outbound_relationships_by_name relationships_desc.has_key?(:self) ? relationships_by_name[:self] : {} end |
#register_named_relationship(subject, name, predicate, opts) ⇒ Object
Please use #register_relationship_desc instead.
447 448 449 450 |
# File 'lib/active_fedora/relationships_helper.rb', line 447 def register_named_relationship(subject, name, predicate, opts) logger.warn("Deprecation: register_named_relationship has been deprecated. Please call register_relationship_desc instead.") register_relationship_desc(subject, name, predicate, opts) end |
#register_named_subject(subject) ⇒ Object
Please use #register_relationship_desc_subject instead.
441 442 443 444 |
# File 'lib/active_fedora/relationships_helper.rb', line 441 def register_named_subject(subject) logger.warn("Deprecation: register_named_subject has been deprecated. Please call register_relationship_desc_subject instead.") register_relationship_desc_subject(subject) end |
#register_relationship_desc(subject, name, predicate, opts = {}) ⇒ Object
** EXPERIMENTAL **
Internal method that adds a relationship description for a relationship name and predicate pair to either an outbound (:self) or inbound (:inbound) relationship types. This method just calls the class method counterpart of this method.
74 75 76 |
# File 'lib/active_fedora/relationships_helper.rb', line 74 def register_relationship_desc(subject, name, predicate, opts={}) self.class.register_relationship_desc(subject, name, predicate, opts) end |
#register_relationship_desc_subject(subject) ⇒ Object
Internal method that ensures a relationship subject such as :self and :inbound exist within the relationships_desc hash tracking relationships metadata. This method just calls the class method counterpart of this method.
61 62 63 |
# File 'lib/active_fedora/relationships_helper.rb', line 61 def register_relationship_desc_subject(subject) self.class.register_relationship_desc_subject(subject) end |
#relationship_model_type(name) ⇒ Class
** EXPERIMENTAL **
Return the value of :type for the relationship for name passed in if defined It defaults to ActiveFedora::Base.
258 259 260 261 262 263 264 265 266 |
# File 'lib/active_fedora/relationships_helper.rb', line 258 def relationship_model_type(name) if is_relationship_name?(name,true) subject = outbound_relationship_names.include?(name)? :self : :inbound if relationships_desc[subject][name].has_key?(:type) return class_from_name(relationships_desc[subject][name][:type]) end end return nil end |
#relationship_names ⇒ Array
** EXPERIMENTAL **
Return array all relationship names
185 186 187 188 189 190 191 |
# File 'lib/active_fedora/relationships_helper.rb', line 185 def relationship_names names = [] relationships_desc.each_key do |subject| names = names.concat(relationships_desc[subject].keys) end names end |
#relationship_predicates ⇒ Hash
** EXPERIMENTAL **
Return hash of relationship names and predicate pairs (inbound and outbound). This method calls the class method version of this method to get the static settings defined in the class definition.
161 162 163 |
# File 'lib/active_fedora/relationships_helper.rb', line 161 def relationship_predicates @relationship_predicates ||= relationship_predicates_from_class end |
#relationship_predicates_from_class ⇒ Hash
** EXPERIMENTAL **
Return hash of relationship names and predicate pairs from class. It retrieves this information via the relationships_desc hash in the class.
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/active_fedora/relationships_helper.rb', line 170 def relationship_predicates_from_class rels = {} relationships_desc.each_pair do |subj, names| rels[subj] = {} names.each_pair do |name, args| rels[subj][name] = args[:predicate] end end return rels end |
#relationship_query(relationship_name) ⇒ String
Call this method to return the query used against solr to retrieve any objects linked via the relationship name given.
Instead of this method you can also use the helper method [relationship_name]_query, i.e. method “parts_query” for relationship “parts” to return the same value
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/active_fedora/relationships_helper.rb', line 374 def relationship_query(relationship_name) query = "" if self.class.is_bidirectional_relationship?(relationship_name) id_array = [] predicate = outbound_relationship_predicates["#{relationship_name}_outbound"] if !outbound_relationships[predicate].nil? outbound_relationships[predicate].each do |rel| id_array << rel.gsub("info:fedora/", "") end end query = self.class.bidirectional_relationship_query(pid,relationship_name,id_array) elsif outbound_relationship_names.include?(relationship_name) id_array = [] predicate = outbound_relationship_predicates[relationship_name] if !outbound_relationships[predicate].nil? outbound_relationships[predicate].each do |rel| id_array << rel.gsub("info:fedora/", "") end end query = self.class.outbound_relationship_query(relationship_name,id_array) elsif inbound_relationship_names.include?(relationship_name) query = self.class.inbound_relationship_query(pid,relationship_name) end query end |
#relationships_by_name(outbound_only = true) ⇒ Hash
** EXPERIMENTAL **
Gets the relationships hash with subject mapped to relationship names instead of relationship predicates (unlike the “relationships” method in SemanticNode) It has an optional parameter of outbound_only that defaults true. If false it will include inbound relationships in the results. Also, it will only reload outbound relationships if the relationships hash has changed since the last time this method was called.
88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/active_fedora/relationships_helper.rb', line 88 def relationships_by_name(outbound_only=true) #make sure to update if relationships have been updated if @relationships_are_dirty == true @relationships_by_name = relationships_by_name_from_class() @relationships_are_dirty = false end #this will get called normally on first fetch if relationships are not dirty @relationships_by_name ||= relationships_by_name_from_class() outbound_only ? @relationships_by_name : @relationships_by_name.merge(:inbound=>inbound_relationships_by_name) end |
#relationships_by_name_from_class ⇒ Hash
** EXPERIMENTAL **
Gets relationships by name from the class using the current relationships hash and relationship name,predicate pairs.
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/active_fedora/relationships_helper.rb', line 105 def relationships_by_name_from_class() rels = {} relationship_predicates.each_pair do |subj, names| if relationships.has_key?(subj) rels[subj] = {} names.each_pair do |name, predicate| rels[subj][name] = (relationships[subj].has_key?(predicate) ? relationships[subj][predicate] : []) end end end return rels end |
#relationships_desc ⇒ Hash
** EXPERIMENTAL **
Return hash that persists relationship metadata defined by has_relationship calls
241 242 243 |
# File 'lib/active_fedora/relationships_helper.rb', line 241 def relationships_desc @relationships_desc ||= relationships_desc_from_class end |
#relationships_desc_from_class ⇒ Hash
** EXPERIMENTAL **
Get class instance variable relationships_desc that holds has_relationship metadata
249 250 251 |
# File 'lib/active_fedora/relationships_helper.rb', line 249 def relationships_desc_from_class self.class.relationships_desc end |
#remove_named_relationship(name, object) ⇒ Object
Please use #remove_relationship_by_name instead.
531 532 533 534 |
# File 'lib/active_fedora/relationships_helper.rb', line 531 def remove_named_relationship(name,object) logger.warn("Deprecation: remove_named_relationship has been deprecated. Please call remove_relationship_by_name instead.") remove_relationship_by_name(name,object) end |
#remove_relationship_by_name(name, object) ⇒ Boolean
** EXPERIMENTAL **
Remove an object for the given relationship name
297 298 299 300 301 302 303 |
# File 'lib/active_fedora/relationships_helper.rb', line 297 def remove_relationship_by_name(name, object) if is_relationship_name?(name,true) remove_relationship(outbound_relationship_predicates[name],object) else return false end end |