Displaying 20 results from an estimated 37 matches for "attribute_methods".
2008 Jun 24
2
wrong number of arguments (1 for 0) when using respond_to?
...'''' ).
gsub( /^[\-]/, '''' ) if model.respond_to?( :path )
end
end
end
class ActiveRecord::Base
include Pathmaker
end
wrong number of arguments (1 for 0)
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:102:in
`sum''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:102:in
`instance_method_already_implemented?''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:72:in
`define_attribute_met...
2008 Jul 31
2
Freeze field in active record
Hello,
I have a freeze field in a table (that I can''t change).
When I try to find a record in this table I have the exception :
C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.1.0/lib/active_record/attribute_methods.rb:104:in
`instance_method_already_implemented?''
C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.1.0/lib/active_record/attribute_methods.rb:72:in
`define_attribute_methods''
C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.1.0/lib/ac...
2008 Nov 19
3
Rails.cache and problem with model id?
...each do |fetish| -%>
<li><%= link_to fetish.name, "/fetishes/#{fetish.id}", :class =>
"size#{fetish.tag_size}"%></li>
<% end -%>
....
I get the following error:
stack level too deep
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:244:in
`method_missing''
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/attribute_methods.rb:245:in
`method_missing''
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.2/lib/active_record/base.rb:2163:in
`to_param''
(eval):2:in `fetish_path''
app/view...
2009 Feb 02
9
ActiveRecord Unexplainable SystemStackError - Only in WEBrick
...ss.
WEBrick and my tests are running as the same user, with a `ulimit -s`
of 10240. Plus the query works sometimes so I don''t think this
matters.
Here''s the trace:
/usr/lib/ruby/1.8/set.rb:93:in `empty?''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
attribute_methods.rb:64:in `generated_methods?''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
attribute_methods.rb:237:in `method_missing''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
attribute_methods.rb:245:in `method_missing''
/usr/lib/ruby/gems/1...
2013 Nov 09
1
ActiveRecord return normal?
...t this result:
In the Beginning Rails 4 book
I''m following this step:
irb(main):097:0> article.location = "Toronto, ON"
Here''s what I get:
RuntimeError: can''t modify frozen Hash
* from
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.1/lib/active_record/attribute_methods/write.rb:45:in
`[]=''*
* from
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.1/lib/active_record/attribute_methods/write.rb:45:in
`write_attribute''*
* from
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.1/lib/active_record/attribute_methods/dirty.rb:70:in
`write_attribute...
2008 Feb 22
2
ActiveRecord::DangerousAttributeError ???
...error and framework trace:
ActiveRecord::DangerousAttributeError in ApplicationController#index
toggle is defined by ActiveRecord
RAILS_ROOT: /usr/local/apache2/htdocs/dps2
Application Trace | Framework Trace | Full Trace
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
attribute_methods.rb:88:in `instance_method_already_implemented?''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
attribute_methods.rb:64:in `define_attribute_methods''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
attribute_methods.rb:63:in `each...
2008 Dec 15
0
insecure: can't modify hash
...blem occurs (only on the prod server, not locally), when i
try to register a new user with restful_authentication.
Once in a while, i get the following error when trying to sign up as a
new user:
Insecure: can''t modify hash
usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:309:in
`delete''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:309:in
`write_attribute_without_dirty''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/dirty.rb:139:in
`write_attribute''
/usr/lib/ruby/gems/1.8/gems/a...
2009 Jun 22
1
getting error can't modify frozen hash
Hi,
When I upgraded my rails application to rails 2.3.2 I am getting
error ''can''t modify frozen hash'' on using
@something.update_attribute(params[:something]).
Can anyone help me who is familiarize with this bug?
Thanks,
2008 Jun 07
2
rcov causing a segmentation fault on rspec 1.1.4 and rails 2.1
Hello again :)
I''m trying to run rcov on my specs here but i''m getting a lot of
segmentation faults (and they usually happen at different places):
/home/mauricio/NetBeansProjects/reeds/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:211:
[BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i486-linux]
/home/mauricio/NetBeansProjects/reeds/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/module/introspection.rb:60:
[BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i486-linux]
Is there any way to f...
2008 Jul 16
3
constructor in model
...ot;
end
end
When i do ac = Activation.new I gget
NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
from C:/rails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/
active_record/attribute_methods.rb:202:in `method_missing''
from C:/Documents and Settings/AIR14607/My Documents/prive/rails/
TeamGeist/app/models/activation.rb:5:in `initialize''
from (irb):2:in `new''
from (irb):2
Someone knows why?
thanks
--~--~---------~--~----~------------~-------~-...
2008 Mar 08
9
Newbie worries with "Developing Rails Applications on Max OSX Leopard"
...when I try to create an "expense", I get a message
saying :
>> event.expenses.create(:vendor => vendor1, :amount => 75.00)
NoMethodError: undefined method `expenses'' for #<Event:0x125e008>
from /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/
attribute_methods.rb:205:in `method_missing''
from (irb):2
Could anybody help me ? I have checked the classes files, everything
seems according to the article. I did checks on the database, the
table "expenses" has been created but is empty. The "id" fiels are
present in each of the tab...
2008 Jul 08
0
Bug with serialized columns in console ?
...with such a
serialized column in the console window :
>> s=Server.find_by_nom "a_server"
ActiveRecord::SerializationTypeMismatch: visa was supposed to be a
Hash, but was a String
from D:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.0.2/lib/active_record/attribute_methods.rb:244:i
n `unserialize_attribute''
from D:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.0.2/lib/active_record/attribute_methods.rb:216:i
n `read_attribute''
from D:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/
activerecord-2.0.2/lib/active_r...
2013 Nov 18
1
wrong number of arguements (1 for 0) on ActiveRecord::Base#send
...etc.
So my code ends up like this:
model.send(''content'', ''some content'')
And it blows up with an error:
ArgumentError: wrong number of arguments (1 for 0)
/home/zatz/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activerecord-4.0.1
/lib/active_record/attribute_methods/read.rb:58:in
`__temp__37964756f59646''
/home/zatz/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activerecord-4.0.1
/lib/active_record/attribute_methods.rb:150:in `method_missing''
And I''m stumped. What''s going on?
A very big thank you ahead of time to...
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
...39;'t give me any information hinting where the
problem is:
irb(main):054:0> reload!;User.last.save!
Reloading...
NameError: undefined local variable or method `to_ary'' for
#<User:0x4ed5d20>
from
D:/ruby192/lib/ruby/gems/1.9.1/gems/activemodel-3.0.0.rc/lib/active_model/attribute_methods.rb:364:in
`method_missing''
from
D:/ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0.rc/lib/active_record/attribute_methods.rb:46:in
`method_missing''
from
D:/ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.0.rc/lib/active_record/connection_adapters/abstract/dat...
2011 Feb 05
3
ActiveModel::AttributeMethods limiting
...p-by-step in DataMapper-like manner.
class Model
include ActiveModel::Dirty
def self.property(name, klass = String)
define_property_accessors(name, klass)
# This method will be called once, because of
https://github.com/rails/rails/blob/master/activemodel/lib/active_model/attribute_methods.rb#L263
define_attribute_methods([name])
end
end
class Article < Model
property :title
property :body
property :published_at, Time
end
In the above example, attribute methods will be defined just
for :title. I don''t see any nice workaround.
So what is the purp...
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many
of the other, implemented through a join table (so it''s like a habtm
without the habtm).
For the next version of our app, we''re refactoring to RESTful, and i''m
having trouble with my nested resources/routes. I tried this, in
routes.rb:
map.resources :assets do |assets|
assets.resources
2014 Feb 17
0
Need help -FATAL: database "catarse_development" does not exist
...y-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/connection_handling.rb:53:in
`connection'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/model_schema.rb:203:in
`table_exists?'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/attribute_methods/primary_key.rb:92:in
`get_primary_key'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/attribute_methods/primary_key.rb:77:in
`reset_primary_key'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activerecord-4.0.2/lib/active_record/attribute_methods/primary_key.rb:65:i...
2009 Mar 14
2
Pobrem with REST routes
...as/1/solucions
It shows me this error:
NoMethodError in SolucionsController#index
undefined method `find'' for #<Encuesta:0x7f790aa4fdc8>
RAILS_ROOT: /home/jose/marzo
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/attribute_methods.rb:260:in
`method_missing''
app/controllers/solucions_controller.rb:94:in `find_encuesta_pregunta''
Parameters:
{"encuesta_id"=>"1",
"pregunta_id"=>"1"}
My code-> Solucion controller
before_filter :find_encuesta_pregunta
def...
2008 Mar 13
3
Refreshing a page gives a "stack level too deep" error.
...source,
asset), :confirm => ''Are you sure?'', :method => :delete %></td>
16: </tr>
RAILS_ROOT: /home/jars/rails/lesson_planner/branches/bundles
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:186:in
`method_missing''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:194:in
`method_missing''
/usr/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1948:in
`to_param''
(eval):2:in `resource_asset_path''...
2012 Feb 14
4
What I'm doing wrong, has_and_belong_to_many
...#39;'M'', ''2012-02-14 01:39:56'')
(65.6ms) COMMIT
=> true
1.9.3-p0 :009 > group << email
NoMethodError: undefined method `<<'' for #<Group:0xa7efb80>
from
/home/felipe/.rvm/gems/ruby-1.9.3-p0/gems/activemodel-3.2.1/lib/active_model/attribute_methods.rb:407:in
`method_missing''
from
/home/felipe/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:126:in
`method_missing''
from (irb):9
from
/home/felipe/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in
`start...