Does anyone know of a gem which uses fixtures for testing? I looked at
devise, arel etc but they do not use fixtures. Just trying to learn proper
usage of fixtures.
Of course Rails itself uses fixtures a lot but I am looking for other
simpler gems.
Thanks
- Neeraj
On Thursday, July 5, 2012
Case 1:
create_table :users, :id = false, :primary_key = :user_id do |t|
t.integer :user_id
t.string :name
t.timestamps
end
Above migration produces following sql: CREATE TABLE
users (user_id integer, name varchar(255), created_at
datetime, updated_at datetime)
Exactly same sql would be
is only a connivence for naming and auto
incrementing integer column per adapter.
- Ken
On Jul 8, 2010, at 10:02 AM, Neeraj Singh wrote:
Case 1:
create_table :users, :id = false, :primary_key = :user_id do |t|
t.integer :user_id
t.string :name
t.timestamps
end
Above
to accommodate your edge case. Either way the schema
statements will allow you to do all you want for the create table block.
- Ken
On Jul 8, 2010, at 1:10 PM, Neeraj Singh wrote:
Hi Ken,
My intent is to fix the code. However before that I want to verify
that I am on the right path
`.`user_id` WHERE (tasks.id is not null)
I think the problem is, that the single sql query returns 3 rows for
task2 (as described in my first post), since Rails edge the to_json/
to_xml return these 3 rows (and each row includes 3 users).
On 25 Jun., 05:56, Neeraj Singh neerajdotn...@gmail.com
for
task2 (as described in my first post), since Rails edge the to_json/
to_xml return these 3 rows (and each row includes 3 users).
On 25 Jun., 05:56, Neeraj Singh neerajdotn...@gmail.com wrote:
Hi David,
This is what I found with rails edge.
puts Project.find(2).to_xml(:include
Hi David,
This is what I found with rails edge.
puts Project.find(2).to_xml(:include = {:tasks = {:include
= :users}})
project
namepr2/name
created-at type=datetime2010-06-25T03:50:57Z/created-at
updated-at type=datetime2010-06-25T03:50:57Z/updated-at
id type=integer2/id
tasks
This is that api I propose. If it is agreed upon by core team then a
patch can easily be created.
# create a demo app with prototype javascript
# in this way current behavior is not changed
rails init demo
# create a demo app with latest stable jquery
# http://github.com/rails/jquery-ujs should
class Brake
scope :good, where(:quality = 'good')
end
Brake.all.select :nil? #= works fine
Brake.good.select :nil? #= FAILS
Last statement fails because Brake.good.select is returning
ActiveRecord::Relation and not an array.
I have posted a detailed discussion on ticket #4589 .
The sql that I posted came out after testing the exact case provided
by the author of the ticket. While composing this email I did not
layout the full hierarchy.
@Colin. It is definitely due to class loading. If in development I
load Agent then query will include Agent too.
script/console
Agent
Since you have deleted all of the original post and my comments the
above now makes no sense. No-one reading this will know what your
problem is without going back to the previous mail, which is something
one should not normally be forced to do.
Extremely sorry about that. I have created a
User.find_by_name 'agent' generates a sql that does not use Agent or
SuperAgent even if they are loaded.
However the behavior of Agent.find_by_name 'agent' is different if
SuperAgent is loaded.
@Colin: SuperAgent should be a subclass of Agent. I have updated the
gist with this info.
@Mislav:
Thanks everyone for the input. I understand what's going on now.
I will mark ticket #4516 as invalid.
On May 12, 10:51 am, Xavier Noria f...@hashref.com wrote:
On Wed, May 12, 2010 at 4:36 PM, Mislav Marohnić
mislav.maroh...@gmail.com wrote:
When you're querying a parent that doesn't have
I have updated ticket
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4149-strange-require-behavior-in-development-environment#ticket-4149-10
with my thoughts.
Would appreciate any comments on how to go about resolving the issue
in dependencies.rb .
--
You received this
class User
end
class Agent User
end
script/console production
User.find_by_name 'john'
SELECT people.* FROM people WHERE (((people.type = 'User' OR
people.type = 'Manager') OR people.type = 'Agent')) AND
(people.name = 'agent') LIMIT 1
In development mode.
script/console
User.find_by_name
Please take a look at this gist http://gist.github.com/395267 .
It seems inverse_of is not working as I expect it to. Or am I missing
something here?
Thanks
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Core group.
To post to this group, send
Thanks Michael for the clarification.
Any thoughts on should Trap.first.dungeon be blowing up?
- Neeraj
On May 9, 6:30 pm, Michael Koziarski mich...@koziarski.com wrote:
It seems inverse_of is not working as I expect it to. Or am I missing
something here?
inverse_of isn't an identity map,
17 matches
Mail list logo