Re: [Rails-core] assign_attributes method not found

2014-09-02 Thread Ryan Bigg
Hi skt,




First of all: I would highly encourage you to upgrade immediately to at least 
3.0.20.



Second: What method are you calling exactly to get that error?

On Wed, Sep 3, 2014 at 2:35 PM, skt  wrote:

> Hello,
> I am on an old version of Rails (3.0.5) and can't upgrade right now. When I 
> try to use assign_attributes on a model I get the error that the method is 
> not found as below
> NoMethodError - undefined method `assign_attributes' for 
> #:
>   activemodel (3.0.5) lib/active_model/attribute_methods.rb:364:in 
> `method_missing'
>   activerecord (3.0.5) lib/active_record/attribute_methods.rb:46:in 
> `method_missing'
> I searched for the method in the classes where update_attributes is defined 
> but indeed I couldn't find assign_attributes defined in any of the gems. 
> From the history of the method in the docs 
>  I 
> understand it was created in 2.3.8 so I would think the method would be 
> there in 3.0.5.
> Any thoughts on why my ActiveRecord 3.0.5 gem doesn't have this method 
> defined?
> Thanks,
> -S
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread skt
Thanks Ryan.

I have a User model (using Devise/Omniauth) and I call the 
assign_attributes on an instance of User.

Part of what I am wondering is why isn't there a definition of 
assign_attributes in the ActiveRecord::Base class in 3.0.5 that I am using.

Thanks for any insights/pointers.

-S

On Tuesday, September 2, 2014 9:37:20 PM UTC-7, Ryan Bigg wrote:
>
> Hi skt,
>
> First of all: I would highly encourage you to upgrade immediately to at 
> least 3.0.20.
>
> Second: What method are you calling exactly to get that error?
>
>
> On Wed, Sep 3, 2014 at 2:35 PM, skt > 
> wrote:
>
>> Hello,
>>
>> I am on an old version of Rails (3.0.5) and can't upgrade right now. When 
>> I try to use assign_attributes on a model I get the error that the method 
>> is not found as below
>>
>> NoMethodError - undefined method `assign_attributes' for 
>> #:
>>   activemodel (3.0.5) lib/active_model/attribute_methods.rb:364:in 
>> `method_missing'
>>   activerecord (3.0.5) lib/active_record/attribute_methods.rb:46:in 
>> `method_missing'
>>
>> I searched for the method in the classes where update_attributes is 
>> defined but indeed I couldn't find assign_attributes defined in any of the 
>> gems. From the history of the method in the docs 
>>  I 
>> understand it was created in 2.3.8 so I would think the method would be 
>> there in 3.0.5.
>>
>> Any thoughts on why my ActiveRecord 3.0.5 gem doesn't have this method 
>> defined?
>>
>> Thanks,
>> -S
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby on Rails: Core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to rubyonrails-co...@googlegroups.com .
>> To post to this group, send email to rubyonra...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread Jason Fleetwood-Boldt
Ryan-
since I see this a lot on the lists, it would be great if there were some easy 
place to see which versions of rails have security alerts against them. I know 
there's this list here on rubygems https://rubygems.org/gems/rails/versions but 
it doesn't show which ones are insecure. 

is that information easily found without having to dig through the security 
alerts?

-Jason


On Sep 3, 2014, at 12:37 AM, Ryan Bigg  wrote:

> Hi skt,
> 
> First of all: I would highly encourage you to upgrade immediately to at least 
> 3.0.20.
> 
> Second: What method are you calling exactly to get that error?
> 
> 
> On Wed, Sep 3, 2014 at 2:35 PM, skt  wrote:
> 
> Hello,
> 
> I am on an old version of Rails (3.0.5) and can't upgrade right now. When I 
> try to use assign_attributes on a model I get the error that the method is 
> not found as below
> 
> NoMethodError - undefined method `assign_attributes' for 
> #:
>   activemodel (3.0.5) lib/active_model/attribute_methods.rb:364:in 
> `method_missing'
>   activerecord (3.0.5) lib/active_record/attribute_methods.rb:46:in 
> `method_missing'
> 
> I searched for the method in the classes where update_attributes is defined 
> but indeed I couldn't find assign_attributes defined in any of the gems. From 
> the history of the method in the docs I understand it was created in 2.3.8 so 
> I would think the method would be there in 3.0.5.
> 
> Any thoughts on why my ActiveRecord 3.0.5 gem doesn't have this method 
> defined?
> 
> Thanks,
> -S
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread Jason Fleetwood-Boldt

You need to download a proper IDE my friend, like RubyMine (which I love, but 
there are others)

Specifically, you need to learn how to use the "Go to Declaration" feature of 
your IDE, which can give you that answer and take you directly to the part of 
ActiveRecord where that might be defined. 


On Sep 3, 2014, at 10:12 AM, skt  wrote:

> Thanks Ryan.
> 
> I have a User model (using Devise/Omniauth) and I call the assign_attributes 
> on an instance of User.
> 
> Part of what I am wondering is why isn't there a definition of 
> assign_attributes in the ActiveRecord::Base class in 3.0.5 that I am using.
> 
> Thanks for any insights/pointers.
> 
> -S

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread skt
Hi Jason,

I actually use RubyMine and Command-B takes you to the declaration of 
function but since there is no declaration it tells me so. The same command 
takes me to the declaration of update_attributes when I try it on that and 
there is no assign_attributes function that I can find in 3.0.5.

Thanks for any pointers on why this function is not there in 3.0.5.

-S

On Wednesday, September 3, 2014 7:56:36 AM UTC-7, Jason FB wrote:
>
>
> You need to download a proper IDE my friend, like RubyMine (which I love, 
> but there are others)
>
> Specifically, you need to learn how to use the "Go to Declaration" feature 
> of your IDE, which can give you that answer and take you directly to the 
> part of ActiveRecord where that might be defined. 
>
>
> On Sep 3, 2014, at 10:12 AM, skt > wrote:
>
> Thanks Ryan.
>
> I have a User model (using Devise/Omniauth) and I call the 
> assign_attributes on an instance of User.
>
> Part of what I am wondering is why isn't there a definition of 
> assign_attributes in the ActiveRecord::Base class in 3.0.5 that I am using.
>
> Thanks for any insights/pointers.
>
> -S
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread Matt Jones
assign_attributes went away in the move from 2.3 -> 3.0, then re-appeared for 
3.1.0. In 3.0.5, the closest equivalent is plain `attributes=`.

Regarding security updates, the best versions to use security-wise are always 
(in descending order of preference):

* GREAT: the current release version (4.1.5 now, with 4.2 in beta)

* OKAY: the most-recent release of the previous version (4.0.9)

* KINDA NOT ENTIRELY BAD: the most-recent release of the any versions before 
*that* (3.2.19, 3.1.12, 3.0.20)

Older versions *only* get security updates, so the final releases in a 
particular line are almost always solving important security issues.

—Matt Jones

On Sep 3, 2014, at 10:12 AM, skt  wrote:

> Thanks Ryan.
> 
> I have a User model (using Devise/Omniauth) and I call the assign_attributes 
> on an instance of User.
> 
> Part of what I am wondering is why isn't there a definition of 
> assign_attributes in the ActiveRecord::Base class in 3.0.5 that I am using.
> 
> Thanks for any insights/pointers.
> 
> -S
> 
> On Tuesday, September 2, 2014 9:37:20 PM UTC-7, Ryan Bigg wrote:
> Hi skt,
> 
> First of all: I would highly encourage you to upgrade immediately to at least 
> 3.0.20.
> 
> Second: What method are you calling exactly to get that error?
> 
> 
> On Wed, Sep 3, 2014 at 2:35 PM, skt  wrote:
> 
> Hello,
> 
> I am on an old version of Rails (3.0.5) and can't upgrade right now. When I 
> try to use assign_attributes on a model I get the error that the method is 
> not found as below
> 
> NoMethodError - undefined method `assign_attributes' for 
> #:
>   activemodel (3.0.5) lib/active_model/attribute_methods.rb:364:in 
> `method_missing'
>   activerecord (3.0.5) lib/active_record/attribute_methods.rb:46:in 
> `method_missing'
> 
> I searched for the method in the classes where update_attributes is defined 
> but indeed I couldn't find assign_attributes defined in any of the gems. From 
> the history of the method in the docs I understand it was created in 2.3.8 so 
> I would think the method would be there in 3.0.5.
> 
> Any thoughts on why my ActiveRecord 3.0.5 gem doesn't have this method 
> defined?
> 
> Thanks,
> -S
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-co...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Rails-core] assign_attributes method not found

2014-09-03 Thread skt
I have temporarily solved the problem (till I upgrade) with the following 
code in one of my libraries

class ActiveRecord::Base
  def assign_attributes(attributes)
attributes.each_pair { |k, v| send("#{k}=", v) if respond_to?("#{k}=") 
} if attributes
  end
end

If you see any issue with this in 3.0.5 then please provide feedback - 
seems to work ok. I got this code from a posting in one of the forums.

Thanks,
-S

On Wednesday, September 3, 2014 11:41:59 AM UTC-7, Matt jones wrote:
>
> assign_attributes went away in the move from 2.3 -> 3.0, then re-appeared 
> for 3.1.0. In 3.0.5, the closest equivalent is plain `attributes=`.
>
> Regarding security updates, the best versions to use security-wise are 
> always (in descending order of preference):
>
> * GREAT: the current release version (4.1.5 now, with 4.2 in beta)
>
> * OKAY: the most-recent release of the previous version (4.0.9)
>
> * KINDA NOT ENTIRELY BAD: the most-recent release of the any versions 
> before *that* (3.2.19, 3.1.12, 3.0.20)
>
> Older versions *only* get security updates, so the final releases in a 
> particular line are almost always solving important security issues.
>
> —Matt Jones
>
> On Sep 3, 2014, at 10:12 AM, skt > wrote:
>
> Thanks Ryan.
>
> I have a User model (using Devise/Omniauth) and I call the 
> assign_attributes on an instance of User.
>
> Part of what I am wondering is why isn't there a definition of 
> assign_attributes in the ActiveRecord::Base class in 3.0.5 that I am using.
>
> Thanks for any insights/pointers.
>
> -S
>
> On Tuesday, September 2, 2014 9:37:20 PM UTC-7, Ryan Bigg wrote:
>>
>> Hi skt,
>>
>> First of all: I would highly encourage you to upgrade immediately to at 
>> least 3.0.20.
>>
>> Second: What method are you calling exactly to get that error?
>>
>>
>> On Wed, Sep 3, 2014 at 2:35 PM, skt  wrote:
>>
>>> Hello,
>>>
>>> I am on an old version of Rails (3.0.5) and can't upgrade right now. 
>>> When I try to use assign_attributes on a model I get the error that the 
>>> method is not found as below
>>>
>>> NoMethodError - undefined method `assign_attributes' for 
>>> #:
>>>   activemodel (3.0.5) lib/active_model/attribute_methods.rb:364:in 
>>> `method_missing'
>>>   activerecord (3.0.5) lib/active_record/attribute_methods.rb:46:in 
>>> `method_missing'
>>>
>>> I searched for the method in the classes where update_attributes is 
>>> defined but indeed I couldn't find assign_attributes defined in any of the 
>>> gems. From the history of the method in the docs 
>>>  I 
>>> understand it was created in 2.3.8 so I would think the method would be 
>>> there in 3.0.5.
>>>
>>> Any thoughts on why my ActiveRecord 3.0.5 gem doesn't have this method 
>>> defined?
>>>
>>> Thanks,
>>> -S
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ruby on Rails: Core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to rubyonrails-co...@googlegroups.com.
>>> To post to this group, send email to rubyonra...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/rubyonrails-core.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-co...@googlegroups.com .
> To post to this group, send email to rubyonra...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails-core] assign_attributes method not found

2014-09-04 Thread Jason Fleetwood-Boldt

indeed... sorry I just get in the habit of helping newbies who do would do well 
to learn more advanced introspection/debegging techniques. My bad.

Maybe your method is defined as delegate :x, :to => :y   ?  I hate that those 
don't work with Go-To-Declaration -- really drives me nuts



If you still can't find it, open up console, replace the object you are trying 
to introspect, and try @foo.method(:assign_attributes).source_location -- that 
should tell you exactly where it is defined.



On Sep 3, 2014, at 2:18 PM, skt  wrote:

> Hi Jason,
> 
> I actually use RubyMine and Command-B takes you to the declaration of 
> function but since there is no declaration it tells me so. The same command 
> takes me to the declaration of update_attributes when I try it on that and 
> there is no assign_attributes function that I can find in 3.0.5.
> 
> Thanks for any pointers on why this function is not there in 3.0.5.
> 
> -S

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.