Fri 2008-08-22 ( En pr bl )

Camping sessions not working lately? Well, it’s a problem with Rails 2.1, to be more precise: ActiveRecord 2.1.0.

This took me at least 5 hours, but I finally got it: the latest version of AR does Dirty tracking and partial SQL updates. This means it only saves a new value when it thinks the attribute has changed. Nice, but it bugs Camping. So, here’s the patch:

In your camping/lib/session.rb:

class Session < Base
  serialize :ivars
  def []=(k, v) # :nodoc:
    self.ivars_will_change!  # ActiveRecord 2.1 needs this!
    self.ivars[k] = v 
  end 

With this fix, blokk’s login is also working again. It’s built into 0.992 0.993, so you don’t need to sudo vim your Camping gem:

# with fix for ActiveRecord 2.1
include Camping::Session
class Camping::Models::Session
  def []=(k, v)
    ivars_will_change!
    ivars[k] = v
  end
end

UPDATE: Sorry, it seems my brain is on holiday or something. The first fix didn’t fix anything, I just forgot to test it properly. This one should work.

:note => self: Think before using super.

Say something! / Sag was!

Thanks for this - I am planning to use camping for a web app for a friend and I will probably want active record, though I am thinking of having a go with KirbyBase.
Jonty Davis @ 14:37 on Friday, 2008-09-05
1
aYlNlfdX @ 19:26 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:26 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
-1 OR 2+597-597-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
-1 OR 2+527-527-1=0+0+0+1 @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 2+220-220-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 2+774-774-1=0+0+0+1 or 'KhrNC00a'=' @ 19:27 on Tuesday, 2024-08-06
1
-1" OR 2+584-584-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX85FO1oRF'; waitfor delay '0:0:15' -- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXIb59RW9O' OR 693=(SELECT 693 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX6nbpsSY2') OR 573=(SELECT 573 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXchJVKtOK')) OR 155=(SELECT 155 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||' @ 19:27 on Tuesday, 2024-08-06
1
'||(select 1 from (select pg_sleep(15))x)||' @ 19:27 on Tuesday, 2024-08-06
1
''||(select 1 from (select pg_sleep(15))x)||'' @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX'" @ 19:27 on Tuesday, 2024-08-06
1
@@s5cva @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 2+359-359-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 2+500-500-1=0+0+0+1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1' OR 2+483-483-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1' OR 2+437-437-1=0+0+0+1 or 'u15ERJYH'='
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1" OR 2+695-695-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1*if(now()=sysdate(),sleep(15),0)
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
10'XOR(1*if(now()=sysdate(),sleep(15),0))XOR'Z
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1; waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1); waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1 waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1eJlxHn7Z'; waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1 OR 524=(SELECT 524 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1) OR 50=(SELECT 50 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1)) OR 788=(SELECT 788 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
14Pnj0yxL' OR 88=(SELECT 88 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1hrj4GBqe') OR 137=(SELECT 137 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1X63ujw1n')) OR 251=(SELECT 251 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
'||(select 1 from (select pg_sleep(15))x)||'
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
''||(select 1 from (select pg_sleep(15))x)||''
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1'"
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
@@GbxQy
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:29 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:30 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:30 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:31 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:37 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:37 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:58 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:58 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06
1
aYlNlfdX @ 20:02 on Tuesday, 2024-08-06

No markup, just plain monospace text. / Kein Markup, nur Normschrift-Klartext.