lib/common/base.rb in inkwell-1.2.0 vs lib/common/base.rb in inkwell-1.4.1
- old
+ new
@@ -32,12 +32,33 @@
def check_post(obj)
post_class = Object.const_get ::Inkwell::Engine::config.post_table.to_s.singularize.capitalize
raise "post should be a #{user_class.to_s}" unless obj.is_a? post_class
end
+
+ def user_id_attr
+ "#{::Inkwell::Engine::config.user_table.to_s.singularize}_id"
+ end
+
+ def user_class
+ Object.const_get ::Inkwell::Engine::config.user_table.to_s.singularize.capitalize
+ end
+
+ def post_class
+ Object.const_get ::Inkwell::Engine::config.post_table.to_s.singularize.capitalize
+ end
+
+ def community_id_attr
+ "#{::Inkwell::Engine::config.community_table.to_s.singularize}_id"
+ end
+
+ def community_class
+ Object.const_get ::Inkwell::Engine::config.community_table.to_s.singularize.capitalize
+ end
end
module Constants
+
module ItemTypes
POST = 'p'
COMMENT = 'c'
end
\ No newline at end of file