Groups
Groups
Sign in
Groups
Groups
WellRailed
Conversations
About
Send feedback
Help
Check if a class inherits from ActiveRecord::Base?
11 views
Skip to first unread message
Cyrille
unread,
Jun 28, 2009, 6:29:59 PM
6/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WellRailed
Hi guys,
I can't find a clean way to see if a class inherits from
ActiveRecord::Base...
At the moment, I do:
respond_to?(:id_before_type_cast)
But it's obviously a half-arsed solution...
Anybody can suggest something better?
Cheers
Cyrille
Tim Haines
unread,
Jun 28, 2009, 6:32:49 PM
6/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WellR...@googlegroups.com
.is_a?
http://www.ruby-doc.org/core/classes/Object.html#M000371
Henry Maddocks
unread,
Jun 28, 2009, 6:50:12 PM
6/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WellR...@googlegroups.com
On 29/06/2009, at 10:32 AM, Tim Haines wrote:
.is_a?
http://www.ruby-doc.org/core/classes/Object.html#M000371
See also kind_of
http://apidock.com/ruby/Object/kind_of%3F
I've had problems in the past with is_a? but I can't remember why. The docs imply they are the same though.
Cyrille
unread,
Jun 28, 2009, 7:35:51 PM
6/28/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WellRailed
Of course!
Thanks guys.
On Jun 29, 10:50 am, Henry Maddocks <
henry.maddo...@gmail.com
> wrote:
> On 29/06/2009, at 10:32 AM, Tim Haines wrote:
>
> > .is_a?
http://www.ruby-doc.org/core/classes/Object.html#M000371
>
> See also kind_ofhttp://
apidock.com/ruby/Object/kind_of%3F
Reply all
Reply to author
Forward
0 new messages