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

Newbie newbie newbie! Forgot to add a “self.” to the method
definition… :stuck_out_tongue:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs