Sha256: 3cd8007386e07e898158b809ef4657a34b7fbb7267ab2434fbcd6843feb433fc
Contents?: true
Size: 336 Bytes
Versions: 6
Compression:
Stored size: 336 Bytes
Contents
class Tagging < ActiveRecord::Base belongs_to :tag belongs_to :taggable, :polymorphic => true def self.tagged_class(taggable) ActiveRecord::Base.send(:class_name_of_active_record_descendant, taggable.class).to_s end def self.find_taggable(tagged_class, tagged_id) tagged_class.constantize.find(tagged_id) end end
Version data entries
6 entries across 6 versions & 1 rubygems