I don't like this.  This makes me grumpy, and I've even already had my
morning coffee.

obs[0] is a PremiseObservation, save! completed without error, yet
nothing was written to the db.  This is a serious ass-biter:

irb(main):057:0> PremiseObservation.count
=> 0
irb(main):058:0> obs =
PremiseObservation.get_premise_observations(premise) ; obs.size
=> 320
irb(main):059:0> obs[0].is_a?(PremiseObservation)
=> true
irb(main):060:0> obs[0].save!
=> true
irb(main):061:0> PremiseObservation.count
=> 0

FTW?

Full disclosure: PremiseObservation.get_premise_observations()
constructs its data through a (massive) find_by_sql() query, but whose
SELECT takes pains to match the PremiseObservation schema.  I could
understand if obs[0] was tagged readonly as a result, but it's not:

irb(main):062:0> obs[0].readonly?
=> false

How can save! complete without error and yet not save anything?  Either
I've overlooked some key piece of documentation or else this is a bug.
Which is it?

- ff

ps:I'm sure I can work around this by creating a virgin
PremiseObservation and copying each field over into it.  That's a PITA,
but manageable.

pps: bash$ rake about
(in /Users/ff/Developer/dev)
About your application's environment
Ruby version              1.9.2 (x86_64-darwin10.4.0)
RubyGems version          1.3.7
Rack version              1.2
Rails version             3.0.0.rc
Active Record version     3.0.0.rc
Action Pack version       3.0.0.rc
Active Resource version   3.0.0.rc
Action Mailer version     3.0.0.rc
Active Support version    3.0.0.rc
Application root          /Users/ff/Developer/bd
Environment               development
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to