Search the web
Sign In
New User? Sign Up
rails_artist · Only Ruby on Rails Artist here
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
attributes: rails reserved variable :(   Message List  
Reply | Forward Message #8 of 23 |
yesterday, i had a pretty rough working day, i was stucked (along with my
team) with some simple joining. we had the following models -

Attribute
———–
class Attribute < AR:B
belongs_to :category
end

class AttributeValue < AR:B
belongs_to :item
belongs_to :attribute
end

class Item < AR:B
has_many :attribute_values
has_many :attributes, :through => :attribute_values
end

rails wasn't giving much better error message, instead it was saying,
"invalid type, String to Integer..", so far i understood ActiveRecord stuff
was trying to cast a string to integer.

we even didn't know which field was doing this stupidity and so on…
so later we dug down to the rails scripts, we added few debug messages. we
found "[]" was invoked to set "id" string value.

anyway, after digging more into to this issue, today i gave another try
after 7 hours of nice sleep. *it was about rails reserve words*.

though i heard something from the rails community, but i was expecting some
message or errors which explain this issue.

anyway, i always like fail first approach. if something is not possible it
should fail first. at least it should return a meaningful exception.

i believe Active Record should be patched with more clear warning or
exception, if any reserved word is used for model or controller or others it
should let us inform [image: :)] .


--
----------------------------------------------------
nhm tanveer hossain khan (hasan)
http://hasan.we4tech.com
----------------------------------------------------
mobile: +880 1713 090 511
----------------------------------------------------
"work for fun"


[Non-text portions of this message have been removed]




Sat Oct 20, 2007 8:46 am

hasan83bd
Offline Offline
Send Email Send Email

Forward
Message #8 of 23 |
Expand Messages Author Sort by Date

yesterday, i had a pretty rough working day, i was stucked (along with my team) with some simple joining. we had the following models - Attribute ———– ...
nhm tanveer hossain k...
hasan83bd
Offline Send Email
Oct 20, 2007
8:46 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help