Joshua Muheim
2007-Oct-16 21:35 UTC
Extend ActiveRecord::Base with a public_content_columns()?
Hi all
I have added the following code to my application.rb:
class ActiveRecord::Base
def public_content_columns
content_columns.reject{|column| [''created_at'',
''updated_at'',
''lock_version''].include?(column.name)}
end
end
Sadly the following code in a view...
<% MusicArtist.public_content_columns.each do |column| %>
...
gives me an error message the this method does not exist for
MusicArtist.
Any idea?
Thanks
Josh
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Joshua Muheim
2007-Oct-16 21:38 UTC
Re: Extend ActiveRecord::Base with a public_content_columns(
Newbie newbie newbie! Forgot to add a "self." to the method definition... :-P -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---