lib/tekeya/entity.rb in tekeya-0.0.1 vs lib/tekeya/entity.rb in tekeya-0.0.2

- old
+ new

@@ -14,11 +14,11 @@ # define the relation with the activity has_many :activities, as: :entity, class_name: "::Tekeya::Activity", dependent: :destroy do # Returns activities dating up to 10 days in the past def recent - unless ::Tekeya::Configuration.instance.feed_storage_orm == :mongoid + unless ::Tekeya::Configuration.instance.feed_storage_orm.to_sym == :mongoid where("created_at > ?", 10.days.ago).order('created_at DESC') else criteria.where(:created_at.gte => 10.days.ago).desc('created_at') end end @@ -43,10 +43,10 @@ end end has_many :notifications, as: :entity, class_name: "::Tekeya::Notification", dependent: :destroy do def unread - unless ::Tekeya::Configuration.instance.feed_storage_orm == :mongoid + unless ::Tekeya::Configuration.instance.feed_storage_orm.to_sym == :mongoid where(read: false).order('created_at DESC') else criteria.where(read: false).desc('created_at') end end