Module: Interest::Utils
- Defined in:
- lib/interest/utils.rb
Class Method Summary collapse
Class Method Details
.source_type_of(object) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/interest/utils.rb', line 18 def source_type_of(object) if object.is_a?(ActiveRecord::Base) object.class.name elsif object.is_a?(Class) and object < ActiveRecord::Base object.name else object.to_s.classify end end |
.symbolic_name_of(object) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/interest/utils.rb', line 8 def symbolic_name_of(object) if object.is_a?(ActiveRecord::Base) object.class.name elsif object.is_a?(Class) and object < ActiveRecord::Base object.name else object.to_s end.underscore.pluralize end |