Displaying 20 results from an estimated 25 matches for "42s22unknown".
2008 Sep 16
3
has_one :through eager-loading problem
...would be has_many, is this wrong?
has_one :user, :through => :membership
has_one :customer, :through => :membership
end
now if I search for profiles with the :include option:
def index
@profiles = User.find(:all, :include => [:user, :customer])
end
i get an error:
Mysql::Error: #42S22Unknown column ''users.profile_id'' in ''on clause''
obviously, it searches for the profile_id on the wrong place, it
should search it in memberships
anyone has an idea? Thanks..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you a...
2006 Jun 08
2
counter_cache is not looking for children_count with acts_as_tree
...a "pages_count"
column instead.
Here is the relevant part of page.rb model:
class Page < ActiveRecord::Base
acts_as_tree :order => :position, :counter_cache => true
acts_as_list :scope => :parent_id
end
And here is what happens when I create a new page:
Mysql::Error: #42S22Unknown column ''pages_count'' in ''field list'':
UPDATE pages SET pages_count = pages_count + 1 WHERE (id = 2)
Any ideas why it''s not asking for "children_count"?
Jeff
2006 May 30
4
Help with Shopping Cart example from Agile Web Development 2nd Edition
Hi
I get to about page 103 of the book and get an application error. Further
investigation reveals the following error in the dev log:
Mysql::Error: #42S22Unknown column ''id'' in ''where clause'': UPDATE sessions
SET `data` =
''BAh7BzoJY2FydG86CUNhcnQGOgtAaXRlbXNbBm86DUNhcnRJdGVtBzoOQHF1\nYW50aXR5aQY6DUBwcm9kdWN0bzoMUHJvZHVjdAY6EEBhdHRyaWJ1dGVzewsi\nDmltYWdlX3VybCIWL2ltYWdlcy9yYWlscy5wbmciCnRpdGxlIgdzZCIKcHJp\nY2UiCjI...
2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
...ing my own unique id for each record. But, this
breaks acts_as_tree.
Because my new primary key is not an integer, it breaks the SQL query
as follows:
StatementInvalid in PagesController#create
--------------------------------------------------------------------------------------
Mysql::Error: #42S22Unknown column ''1_3'' in ''where clause'': SELECT *
FROM pages WHERE (parent_id = 1_3 AND account_id = 1) ORDER BY
position DESC LIMIT 1
Because parent_id is also now a :string column, the 1_3 should be put
into single quotes like so:
SELECT * FROM pages WHERE (paren...
2006 May 10
4
Single Table Inheritance problem
...m Model:
class Item < ActiveRecord::Base
end
class Article < Item
belongs_to :page
end
Page Model:
class Page < ActiveRecord::Base
end
class Issue < Page
has_many :articles
end
In my controller, when I call @page.articles I am getting the following
problem:
Mysql::Error: #42S22Unknown column ''items.issue_id'' in ''where clause'':
SELECT * FROM items WHERE (items.issue_id = 4) AND ( (items.`type` =
''Article'' ) )
I see exactly where the snafu is ''items.issue_id'' should be
''items.PAGE_id'' (ca...
2006 Jan 31
4
has_one without inverse belongs_to
....
The entities table has a column called users_id that contains the user
id of the user that created the entity.
In entity I have...
has_one :user
... as I want to be able to show the user who created the entity from
the entity object.
But this produces the following error...
Mysql::Error: #42S22Unknown column ''users.entity_id'' in ''where clause'':
SELECT * FROM users WHERE (users.entity_id = 1) LIMIT 1
...Where I want it to select users by users.id.
What do I do? I bet it is easy.
Martin
--
Posted via http://www.ruby-forum.com/.
2006 Jul 13
1
model navigation problem with foreign key
...nces ac_rooms(id)"
end
and i added the belongs_to :ac_room in line_msg.rb and has_many:
:line_msgs to ac_room.rb in the model, but when i did
room = AcRoom.find(...)
<%= render(:partial => "line_msg", :collection => room.line_msgs) %>
but i get error
Mysql::Error: #42S22Unknown column ''line_msgs.ac_room_id'' in ''where
clause'': SELECT * FROM line_msgs WHERE (line_msgs.ac_room_id = 6)
my question is why rails make it into line_msgs.ac_room_id but not
line_msgs.room_id, is there some stupid things i did, thanks.
Excuse me for my poor eng...
2005 Dec 23
2
has_many and belongs_to relationship error
Hi i am getting following error
ActiveRecord::StatementInvalid in Blog#index
Showing app/views/blog/index.rhtml where line #10 raised:
Mysql::Error: #42S22Unknown column ''posts.user_id'' in ''where clause'':
SELECT * FROM posts WHERE (posts.user_id = 4)
Extracted source (around line #10):
7: <div class="separator"> </div>
8: <% end %>
9:
10: <% for post in @posts %>
11: <div cl...
2006 Aug 09
2
has_many through delete issue
...estroy_price
Media.find(params[:id]).prices.find(params[:price_code_id]).destroy
redirect_to :action => ''show'', :id => params[:id]
end
When I call the action the following error is returned:
ActiveRecord::StatementInvalid in MediaController#destroy_price
Mysql::Error: #42S22Unknown column ''prices.id'' in ''where clause'': SELECT
* FROM prices WHERE (prices.id = ''1'' AND (prices.media_id = 82)) LIMIT
1
For this example I''m trying to delete the prices record with media_id of
82 and price_code_id of 1. For some reas...
2006 Apr 22
6
nOOb question: How to use find_all with form input data
Hello,
I''m having a problem utilizing the find_all method with a value from a
form. I keep getting the following error:
Mysql::Error: #42S22Unknown column ''category_id11'' in ''where clause'':
SELECT * FROM items WHERE (category_id11)
The controller seems to be getting the correct data, but my key and
value seem to be mashed together(it''s mashed-hash? )
I''m using a pulldown box that contai...
2006 May 20
3
In a find, can''t you use both :include and :limit ?
...9;ll
require :offset and :limit. Let''s add them in as a test.
employees = Employee.find(
:all,
:limit => 10,
:offset => 1
:include => :skills,
:conditions => ["skill_id = ?",3]
)
WHAMMO! I get hit with this:
ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column
''skill_id'' in ''where clause'': SELECT id FROM employees WHERE (skill_id =
3) LIMIT 1, 10
What gives? I''m obviously a newb and may very well have misunderstood
the purpose of :include, but the fact that it does exactly what I want
it to do (wi...
2008 Jan 04
5
Confused by the unit test results.
I''m testing the relation between two of my models: MessageThread
(parent), which has_many Message (children). When I run the following
test, it gives me an error:
---------------------------------
# test with a valid message
def test_valid_message_new
thread = MessageThread.new :title => ''awesome thread''
message = thread.messages.build(:body
2006 Oct 25
7
rest nested resources - Help please
I can''t believe I''m back again with another rest question. I did go through
the peepcode podcast.
I thought though you can have multiple nested resources, is that not true ?
I have this set up
map.resources :candidates do |candidate|
candidate.resources :canbackgrounds
candidate.resources :canpositions
end
I just coded up teh canpositions and now all
2006 Feb 15
0
MySql adapter error
..., after installing
that gem and then trying to run gem install mysql on my windows server, I''ve
been getting this weird error on every page I try to hit.
If anyone give give me any insight into how I messed this up or how to fix,
it would be much appreciated.
The error is
Mysql::Error: #42S22Unknown column ''joinsincludeconditions'' in ''where
clause'': SELECT COUNT(*) FROM meal_names WHERE (joinsincludeconditions)
If I take the "rails" folder out of my vendor folder, I don''t get the error
but just a blank screen. Here''s the rest of...
2006 Feb 21
0
Rails edge breaks my app
...nd restart the server
(webrick), it works fine. I don''t get any errors. But if I re-add the
..\vendor\rails folder I get errors when accessing any views that have
pagination. Is this a known issue or problem? This is the error:
ActiveRecord::StatementInvalid in Books#list
Mysql::Error: #42S22Unknown column ''joinsincludeconditions'' in ''where
clause'': SELECT COUNT(*) FROM books WHERE (joinsincludeconditions)
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/c...
2008 Jan 10
0
BUG? has_many :through makes funny queries
...t; :owner, :dependent => :destroy
has_many :folders, :through => :gallery
Seems fine, right? So @user.folders should do join between users,
galleries and folders.
users.id (1 in the example) == gallery.owner_id and gallery.id ==
folders.gallery_id
Right? Well it does not.
Mysql::Error: #42S22Unknown column ''galleries.gallery_id'' in ''on
clause'': SELECT folders.* FROM folders INNER JOIN galleries ON
folders.id = galleries.gallery_id WHERE ((galleries.owner_id = 1) AND
(galleries.owner_type = ''User''))
This query doesn''t make a lo...
2006 Feb 15
3
accepting and passing args to find
...d_allowed(session[:user], :order => "name")
# start of the model method:
def self.find_allowed(owner, *args)
projects = self.find_all(args)
...
No matter how I try to pass those args along I get something like the
following error:
ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column
''ordername'' i
n ''where clause'': SELECT * FROM projects WHERE (ordername)
I''ve tried self.find_all(*args), I''ve tried doing various conversions
and nothing seems to work. I''m sure I''m missing something simple, I just...
2006 Aug 02
2
Ajax_Scaffold display from link table
...p.id ] } %>
</div>
documents_controller.rb
@paginator, @documents = paginate(:documents, :order => @sort_by,
:include => :category, :per_page => default_per_page)
I keep getting the following error:
ActiveRecord::StatementInvalid in DocumentsController#component
Mysql::Error: #42S22Unknown column ''categories.document_id'' in ''on
clause'': SELECT COUNT(DISTINCT documents.id) FROM documents LEFT OUTER
JOIN categories ON categories.document_id = documents.id
Can anyone help me and point out where i am going wrong?
--
Posted via http://www.ruby-forum...
2007 Nov 14
1
New Foxy Fixtures (Rails 2) & STI (Single Table Inheritance)
...: hemingway
file_download: hemingway_alpha_zip
created_at: <%= (Time.now - 5.days).to_formatted_s(:db) %>
The problem I''m having is that it''s trying to put file_download into a
column in versions when I run rake test:units
ActiveRecord::StatementInvalid: Mysql::Error: #42S22Unknown column
''file_download'' in ''field list'': INSERT INTO `versions`
(`file_download`, `name`, `project_id`, `updated_at`, `id`,
`revision`, `description`, `created_at`) VALUES
(''hemingway_alpha_zip'', ''Alpha 1'', 2980859, ''20...
2007 Aug 02
4
ActiveRecord Limitation (Advance)
Or is it ?
Need to be able to :-
@search =
Form.find(:all, :include=>[:form_type, :form_type_items], :conditions=>....)
I need in the Form model a :form_type_items, the question is, what is
the relationship type?
Current Models:-
Form
belongs_to :form_type
FormType
has_many :form_types
has_many :form_type_items
FormTypeItem
Belongs_to :form_type
Form
----------------
| id |