Displaying 2 results from an estimated 2 matches for "find_published".
2006 Aug 09
7
changing find method
....find(:all)
it would return only the pages that had pages.published == true.
i thought the def would be something like:
Class Page < ActiveRecord::Base
def find
super
self.find(:all, :conditons => ''published=1'')
end
but it isn''t working.
could possibly do
def find_published
self.find(:all, :conditons => ....)
end
and change all of my find methods to @page.find_published...?
am i going down the wrong train of thought? where/how do i change a
class method to my own needs without ruining the initial method...?
?
thanks for any reference,
harp
--
Posted via htt...
2006 Feb 05
1
return yr/mo archive of posts
looking at ways to return an archive, by year/month
in the past, (via php) i''d do something like pull all the entries,
ordered by date and iterate through them, doing a check on the month and
year and adding them to an array if there was a change
that method doesn''t really feel very fluid or rails-like.
any suggestions?