lib/make_flaggable/flagger.rb in make_flaggable-0.0.2 vs lib/make_flaggable/flagger.rb in make_flaggable-0.0.3
- old
+ new
@@ -55,9 +55,15 @@
success = false
end
success
end
+ def flagged?(flaggable)
+ check_flaggable(flaggable)
+
+ fetch_flaggings(flaggable).try(:first) ? true : false
+ end
+
private
def fetch_flaggings(flaggable)
flaggings.where({
:flaggable_type => flaggable.class.to_s,