upgrade model containing attr_accessible

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

upgrade model containing attr_accessible

fugee ohu
Trying to upgrade the code below 

class Mailboxer::Notification < ActiveRecord::Base 
... 
attr_accessible :body:subject:global:expires if Mailboxer.protected_attributes?

There's no message model The messages are the receipts They belong to notifications which belong to conversations Although there's no message model there's a messages controller which had no strong params  so I put them there and commented out attr_accessible like this 

  def message_params
     params.require(:message).permit(  :body, :subject, :global, :expires)
  end

but that didn't fix the problem that the message object comes up nil in conversation show view

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/742dcdd1-ab00-4382-ad2b-01d61de5f7e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: upgrade model containing attr_accessible

Colin Law
On Sun, 2 Sep 2018 at 21:55, fugee ohu <[hidden email]> wrote:
> ...
> There's no message model The messages are the receipts They belong to notifications which belong to conversations

How can messages belong to notifications if there is no Message model?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu6Q9RGd2PEXd5DPW%2BxqoTd25zwdfiB5zD_By%2B66Tnhiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: upgrade model containing attr_accessible

fugee ohu


On Monday, September 3, 2018 at 3:34:56 AM UTC-4, Colin Law wrote:
On Sun, 2 Sep 2018 at 21:55, fugee ohu <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ebKvc7KhBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">fuge...@...> wrote:
> ...
> There's no message model The messages are the receipts They belong to notifications which belong to conversations

How can messages belong to notifications if there is no Message model?

Colin


Oh sorry it's in the gem 
What I'm trying to figure out now is it has in notification.rb 
   belongs_to :sender, :polymorphic => :true, :required => false
But there's no model that contains as: :sender

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/474326cc-955f-4982-afa0-76688426d7dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.