similar to: To protect or not email attribute of user

Displaying 20 results from an estimated 40000 matches similar to: "To protect or not email attribute of user"

2008 Jul 10
0
User.protected_attributes returning empty Set instead of nil -- causing activerecord/lib/base:2307 to raise
I have a model that uses attr_accessible, and in my tests I get this: RuntimeError (Declare either attr_protected or attr_accessible for User, but not both.): /var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:2307:in `remove_attributes_protected_from_mass_assignment'' /var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ base.rb:2114:in
2009 Jun 09
3
protect_from_forgery doesnt protect from forgery
Maybe I am grasping the full usage of this protect_from_forgery function, but it does not seem to work for me. Imagine the following: A simple website with a user that needs to log in to do certain stuff and a closed off admin section that only certain users can access that have the is_admin field set to true. So to be clear, my User model has a login, password and is_admin. When displaying the
2009 Nov 22
2
WARNING: Can't mass-assign these protected attributes: active
Hi, I''m trying to understand this error: WARNING: Can''t mass-assign these protected attributes: active I had this error before when creating a record.I did not mark the attibutes posted from the form as attr_accessible, so when the following line tries to execute it throwed an Warning in the log, and the record was not saved. @user = User.new(params[:user]) I find out that I
2010 Nov 02
7
Testing attr_accessible (and/or attr_protected)
I''ve been puzzling over how to test that attr_accessible has been set for the correct columns; but the tests I''ve come up with so far seem to fail to fail when I expect. I came across this old message from this list: http://www.mail-archive.com/rspec-users at rubyforge.org/msg01570.html Which seemed like a plausible example, but my attempt (modeled on the example)
2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
(I posted this as a bug in GitHub (https://github.com/rails/rails/issues/7018), but then someone there told me I should post it here, so here it is.) If you set attr_accessible on some properties in an ActiveRecord-descended class, and then attr_protected on others - the class becomes ''default-open'' - if any properties are missed or added later, they will be accessible by
2009 Jun 21
1
cannot do mass_assignment when inherited class ?
I got the following error when trying to create the elibrary instance (rdb:21) @elibrary = Elibrary.new(params[:elibrary]) RuntimeError Exception: Declare either attr_protected or attr_accessible for Elibrary, but not both. params : "elibrary"=>{"title"=>"bingo three", "short_description"=>"something new",
2008 Dec 28
0
:attr_accessible to protect all attributes
Hi, I would like to protect all the attributes of one of my model. This ticket talks about this issue: http://dev.rubyonrails.org/ticket/9631 , and a patch to the documentation was submitted: http://dev.rubyonrails.org/changeset/8032 , which actually states that defining :attr_accessible alone, means all attributes are protected. However when I look at the rails API page for attr_accessible, I
2007 May 21
7
How do I stop a column being updated by model.save?
One of my models has a column that is updated very frequently from a separate process, so it is important that when a record is saved in rails, this column should be left alone. In the update method of the controller I have: @record = MyModel.find(params[:id]) @record.update_attributes(params[:my_model]) params[:my_model] doesn''t have a reference to the column I''m talking
2007 Oct 16
12
Example for attr_accessible?
Is anyone out there writing specs to check attr_accessible fields? I had originally written my spec to check for allowing the desired fields, and then none of the other regular db fields. Unfortunately this isn''t satisfactory, because attr_protected could have been used instead, which of course wouldn''t prevent mass assignment to any whatever=(val) method. I''m thinking
2007 Jan 26
7
How to protect attributes from being updated?
Hi! I''m new to Rails! Rails rox! 1 quesion so far: I have :email attribute in User model. I dont'' want :email to allow to be updated. How do i do this with Rails? Do I have to implement required validation manually? Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2013 Feb 10
0
Nested attributes doesnt get updated
Hi Am building a nested form and my code works fine with sqlite3 but throws errors when using Oracle during update action. Am getting the following error: ActiveRecord::RecordNotFound in AWRequestsController#update Couldn''t find WADetail with ID=5000000015 for AWRequest with ID=5000000022.0 Request *Parameters*: {"utf8"=>"✓",
2006 May 28
0
[SUMMARY] Rails Core Weekly (May 23 - May 28)
Rails Core Weekly May 23 - May 28 [ http://wrath.rubyonrails.org/pipermail/rails-core/2006-May/001500.html ] On may 23 I just missed an opportunity to report on a patch (http://dev.rubyonrails.org/ticket/5167) politely submitted by Francois Beausoleil that adds a generator for observers. Marcel Molina Jr. hates repeating himself so a generator for observers is most welcome. The patch is applied
2006 Jun 21
5
model with not te be updated attributes ?
Hi List, I have a table that contains several fields that must be initialized when first created, but may not be altered afterwards (when updating the other fields) because they can be changed by external processes. I noticed that the ActiveRecord update commands (even update_attribute) only seem to work by loading the complete record, changing fields that need to be changed and doing a full
2010 Jan 21
2
nested forms and attr_accessable
Rails 2.3.5 I am working on a nested form that assigns roles to users through a table called clearances. I have attr_acessable turned off globally in an initializer: ActiveRecord::Base.send(:attr_accessible, nil) I have this set in clearance.rb attr_accessible(:description, :effective_from, :role_id, :superceded_after, :user_id) And this is what params looks like after the
2010 Dec 23
0
has_many :through full stack help
I am trying to implement HMT for the first time and having a ton of trouble. I would like to be able to have the user check a checkbox and fill some extra fields for data input. I have tried so many iterations borrowed from different places I found on the web, none seem to work quite right. Essentially I have two models: ''practice'' and ''system'' where a
2006 Jun 07
4
Question: coding protected methods
Apologies first, because I need to ramp up on Ruby and coding Ruby in Rails, however it''s my 3rd day with this beast :) so I''m asking : When I added protected methods to the model before it was like: protected method.................... end Would this be a valid way to write a protected method as well ?: attr_protected :column1, :column2 Perhaps this particular call
2006 May 11
1
RoR completely ignoring a column when saving changes
I have an action that needs to update two models/two tables in one shot, and it works great, but ignores one column. Here is the action code: (verify_id is irrelevant in this case) [CODE] def edit @page_title = "Edit User" @page_active_3 = "active" if request.post? @user = User.find(params[:id]) @profile = @user.profile verify_id(@user.id,
2012 Apr 27
1
Can't mass-assign protected attributes even if I use attr_accessible
Hi, I''m working on a Rails 3.2.2 application which has JSON APIs and I use a CLI client for inserting some data. It works fine except for the Author model. When I try to create a new post (Post belongs_to :author and Author has_many :posts) I get the following error : <h1> ActiveModel::MassAssignmentSecurity::Error in PostsController#create </h1>
2007 Jan 24
2
attr_accessor vs attr_accessible
Please guide me how to use those two methods. I can''t differentiate them. I was doing something on my model and I have put one field in the attr_accessible method. After that when I try to run the app the app always says my other fields are blank, but they''re all filled up. What''s wrong with it? Thanks --~--~---------~--~----~------------~-------~--~----~ You received
2014 Jun 11
0
my webpage does not send emails confimation/notification
Hello everybody I have a problem with my inquireis, when I want to contact and I send the message, I must receive two emails one of confirmation (client) and other of notification (admin of the web page) but it does not send. The webpage work in production environment. When I watch the log (production.log) I seed this: > > There was an error delivering an inquiry confirmation: > 503