When creating a boolean attribute in ActiveRecord, you get a ? method for
free. Sadly, it's returning false for a true value. Does anyone know what
might be going on?
From my console (for_charity: true). Same behaviour on Rails 2.3.8 and
2.3.11
ruby-1.8.7-p302 m.for_charity?
= false
My model association looks like this
class User ActiveRecord::Base
has_many :correlations
has_many :roles, :through = :correlations
has_many :skills, :through = :correlations
end
class Skill ActiveRecord::Base
has_many :correlations
has_many :roles, :through = :correlations
The actual representation of any attribute type in Rails will depend on the
underlying DBMS as the mapping changes from platform to platform. But if we
assume we're talking about SQLite as an example, it uses a SQLite boolean
which is actually stored as 0 for FALSE or 1 for TRUE, and both of
any idea on this issue ??
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/Sy1kTnVURFJJM29K.
To post to this group, send email to
On 3 June 2011 18:34, Kevin darkint...@gmail.com wrote:
Out of curiosity what should one do if one wants to have a method inherited
by all models? Does rails already have a file for adding methods to the
model base class? Or do we just ram our methods into ActiveModel and call
it a day? I
On 3 June 2011 17:49, skt stibre...@gmail.com wrote:
Hello,
I have a bunch of arrays containing records retrieved from the
database in separate queries. That can't be changed - I have deal with
the different arrays of these records. Each of these records contains,
amongst other data fields,
hello,
i have a rails 3 engine scoped dynamically like this:
scope /:locale do
mount MyEngine::Engine = '', :as = 'my_engine'
end
I can't seem to be able to set my own locale like this:
my_engine.page_path(page, :locale = 'de')
the path is generated like this:
/en/page/12345?locale=de
On 3 June 2011 07:25, Mauro mrsan...@gmail.com wrote:
I've set foreign key at database level.
When I run rspec it says:
permission denied: RI_ConstraintTrigger_111473 is a system trigger:
ALTER TABLE categories ENABLE TRIGGER ALL;ALTER TABLE
categories_suppliers ENABLE TRIGGER ALL;ALTER
On 3 June 2011 23:38, Gordon Yeong anexi...@gmail.com wrote:
On Jun 4, 2011 3:42 AM, Michael Pavling pavl...@gmail.com wrote:
You can monkey patch Object or Class if you really want...
Monkey patches are evil.
Evil is a bit strong :-)
They can have a place. I've found it invaluable in the
Hi,
I've search for documentations on queries with Arel 2 but there is
pretty nothing and all I've found is for Arel 1 so I've run into
NoMethodError: undefined method `[]' for
#Arel::SelectManager:0x0003f1b820 errors with join syntax.
My query is barely simple but involve nesting queries. I
Hello guys
So, finally I make it work. For those that could experience same
problem as me, I can tell how I did.
I have a mac 10.5.8
Preinstalled was ruby 1.8.6 and rails version 1.something.
Tried different ways but none worked (macports, rvm, locomotive etc).
But on the ruby site there is a one
Google seems to indicate that one may simply mixin (Is that the correct Ruby
terminology.) parts of ActiveModel into any class as one sees fit. For
example:http://yehudakatz.com/2010/01/10/activemodel-make-any-ruby-object-feel-like-activerecord/
If memory about the way inheritance works in
Hi,
I'm new on rails, and I would like like to know how I do for I get a link on
title on a block of code (each), and do this link go to show function and
show up.
should be something like link_to article.title, article_path? I already
tried that and I get broken the page.
thanks!
--
% articles.each do |article| %
%= link_to article.title, article_path(article) %
% end %
Is that you figuring out or I missed something wrong?
I'm new on rails, and I would like like to know how I do for I get a link on
title on a block of code (each), and do this link go to show
Nops, thats it. Thanks! =D
On Sat, Jun 4, 2011 at 7:25 PM, Valery Kvon adda...@gmail.com wrote:
% articles.each do |article| %
%= link_to article.title, article_path(article) %
% end %
Is that you figuring out or I missed something wrong?
I'm new on rails, and I would like like to
15 matches
Mail list logo