diff options
author | Andrew Hooker <GeekOnCoffee@gmail.com> | 2012-05-19 20:00:16 -0500 |
---|---|---|
committer | Andrew Hooker <GeekOnCoffee@gmail.com> | 2012-05-19 20:00:16 -0500 |
commit | 86fa2d2f5d0c2bfb9900bb795bfafe78d09c897d (patch) | |
tree | 89aa1c39fcdc2aa5e9d2255d418aa42021abab34 /app/models | |
parent | 6fa5bbdf33b681f7c9595a327a39cc99de7bf638 (diff) | |
download | refinerycms-blog-86fa2d2f5d0c2bfb9900bb795bfafe78d09c897d.tar.gz refinerycms-blog-86fa2d2f5d0c2bfb9900bb795bfafe78d09c897d.tar.bz2 refinerycms-blog-86fa2d2f5d0c2bfb9900bb795bfafe78d09c897d.zip |
Renaming Method to better describe use, Including Deprecation Warning on Old Method
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/refinery/blog/post.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/refinery/blog/post.rb b/app/models/refinery/blog/post.rb index b078272..3e3d85c 100644 --- a/app/models/refinery/blog/post.rb +++ b/app/models/refinery/blog/post.rb @@ -53,10 +53,15 @@ module Refinery end class << self - def by_archive(date) + def by_month(date) where(:published_at => date.beginning_of_month..date.end_of_month) end - + + def by_archive(date) + warn "[Deprecation Warning] Refinery::Blog::Post.by_archive(date) has been replaced with by_month" + by_month(date) + end + def by_year(date) where(:published_at => date.beginning_of_year..date.end_of_year) end |