Re: how to handle >4K session in camping

2013-12-10 Thread låzaro
Sorry for the thread hacking but, how could be run camping as standalone CGI
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Bluebie  escribió:
>Unless you’re running your camping app as a CGI script, the ruby
>instance keeps running, so you could just create a looping thread to do
>it every now and then:  
>
>hours = 2 # cleanup every two hours
>Thread.new do
>  loop do
># some database cleanup stuff
>sleep hours * 60 * 60
>  end
>end
>
>The only trouble with that is you’d have it happening multiple times if
>you run multiple ruby servers behind a proxy like nginx, which is a
>pretty common configuration. Probably cron is the best way to go if you
>can easily do that. Otherwise you could attach it to some other event -
>like you could spawn a thread whenever a user logs in, which cleans up
>the sessions. If you wanted it to happen less frequently you could use
>rand() to generate a random number, then, say, cleanup if rand < 0.01
>if you only wanted to cleanup sessions every 1 out of 100 times someone
>logs in, roughly. That’s a stratergy people use a lot with systems like
>PHP where cron can be difficult to setup and access.
>
>I wouldn’t worry about it too much though. Your sessions will probably
>still be quite small (only a couple dozen kilobytes, right?) so you can
>probably just let them build up and then every six months or year or so
>go and delete all the database records that are more than a week old in
>that table. Storage is so cheap these days!  
>
>—
>Bluebie
>
>
>On Tuesday, 10 December 2013 at 9:29 pm, Francois Sery wrote:
>
>> Bonjour,
>> Thanks for your help. Here is how i've modified my app.
>> now i have
>>  - a 'session' model  
>> - a  "sessions" table with a column for my data...
>> - a session cookie: @state[:sessionid]=SecureRandom.hex
>> It works as wanted but i have one more question.
>>  
>> how do you handle all the obsolete sessions in the database ?  my
>code already delete some sessions. but  some  other sessions can't be
>deleted from the "flow" of my app.  What are the available solutions? 
>cron ? or something else maybe?
>>  
>> Merci.
>>  
>>  
>>  
>>  
>> 2013/12/7 Bluebie mailto:a...@creativepony.com)>
>> > If you fill the session cookie with 4kb of data, that means every
>http request after that to that domain will require the user to upload
>4kb of data, which may not seem like much, but on a mobile phone for
>instance, loading a page with 50 images, that becomes 4*50 = 200kb -
>pretty significant considering most home internet connections do not
>have very fast upload in many countries. On my own internet on a good
>day that’s at least 2 seconds of uploading.  
>> >  
>> > So it is best to use session cookies only to store a very small
>identifier, then store more information in a local database or file. If
>you have a look in the rack project you’ll see some other session
>handlers which do exactly this, so you can keep writing data in to the
>‘session’ but have it stored locally, with only a small cookie with an
>ID number to lookup the local data stored in to the browser.  
>> >  
>> > —
>> > Bluebie
>> >  
>> >  
>> > On Saturday, 7 December 2013 at 8:27 am, Charles McKnight wrote:
>> >  
>> > > Sure wish the W3C would devise a better state mechanism than
>cookies...
>> > >  
>> > > On Dec 6, 2013, at 12:49 PM, Magnus Holm (mailto:judo...@gmail.com)> wrote:  
>> > >  
>> > > > You should not store a large amount of data in the session. The
>> > > > session is stored in a cookie, and everything you store there
>has to
>> > > > be sent back and forth over the network. You can however store
>an ID
>> > > > in the session and lookup data in your database.
>> > > >  
>> > > > // Magnus Holm
>> > > >  
>> > > >  
>> > > > On Tue, Dec 3, 2013 at 12:04 PM, Francois Sery
>mailto:sery.franc...@gmail.com)> wrote:
>> > > > > hi , i need some advices.
>> > > > > I a little Camping app i have to store a cart in a session .
>i tried
>> > > > > achieving it using the default camping/session but it is
>limited to 4K and
>> > > > > my card miss some data.
>> > > > > how can store more than 4k in a session ? thanks.
>> > > > >  
>> > > > > ___
>> > > > > Camping-list mailing list
>> > > > > Camping-list@rubyforge.org
>(mailto:Camping-list@rubyforge.org)
>> > > > > http://rubyforge.org/mailman/listinfo/camping-list
>> > > > >  
>> > > >  
>> > > > ___
>> > > > Camping-list mailing list
>> > > > Camping-list@rubyforge.org (mailto:Camping-list@rubyforge.org)
>> > > > http://rubyforge.org/mailman/listinfo/camping-list
>> > > >  
>> > >  
>> > >  
>> > > "The game's afoot. Follow your spirit, and upon this charge, cry
>God for Harry, England, and St. George." --- Sherlock Holmes
>> > >  
>> > > ___  
>> > > Camping-list mailing list
>> > > Camping-list@rubyforge.org (mailto:Camping-list@rubyforge.org)
>> > > http://rubyf

Re: Camping Blog with Sequel, Thin and Rake

2013-11-14 Thread låzaro
amazing job

Thread name: "Camping Blog with Sequel, Thin and Rake" 
Mail number: 1 
Date: Thu, Nov 14, 2013 
In reply to: Koaps Freeman 
>
> Hi All,
> 
> I just wanted to pass along some code I did recently.
> 
> https://github.com/koaps/camping-thin-blog
> 
> It's basically the Camping example Blog modified to work with Sequel, Thin
> Server and Rake migrations.
> 
> I mainly did this because I'm testing using Camping on JRuby and Celluloid's
> Reel-Rack and since native extensions are problematic on current JRuby, I
> needed an easy alternative to pg gem and Sequel JDBC:Postgres isn't bad, 
> though
> I could have used JDBC from AR.
> 
> 
> As a side note, here's my Nginx/HAProxy setup I'm using to frontend the 
> Camping
> Apps with a backup server to host a static page if the app is down.
> 
> http://nullworks.wordpress.com/2013/11/09/nginx-and-haproxy-for-fun-and-profit/
> 

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Would like some hints on best ways to search for camping questions.

2013-11-04 Thread låzaro
exactly whay do you wanna do with migrations?





Thread name: "Re: Would like some hints on best ways to search for camping 
questions." 
Mail number: 1 
Date: Mon, Nov 04, 2013 
In reply to: Tim Uckun 
>
> Thanks. 
> 
> I might try the IRC but I am in NZ (currently in AU) so my time zones tend to
> be unfriendly to most IRC channels.
> 
> My questions are about non trivial apps.  What do I do about migrations? What
> if I don't want to use markaby? what's a good strateg for breaking your app up
> into different files?.
> 
> 
> 
> 
> On Sat, Nov 2, 2013 at 1:42 AM, låzaro  wrote:
> 
> jusr now we hace a big problem with doc, but here in the mailing list you
> will have all you answers. Also in the IRC channel #camping we could help
> you. I'm  writing new doc about camping and need questions like yours, son
> write me please, and I'll focus the doc via your questions.
> 
> 
> 
> Thread name: "Would like some hints on best ways to search for camping
> questions."
> Mail number: 1
> Date: Fri, Nov 01, 2013
> In reply to: Tim Uckun
> >
> > Hello Campers.
> >
> > On a whim I thought I would try to fool around with camping.   The
> > documentation is nice and does a fine job of covering what it wants to
> cover
> > but I needed some information not covered by the docs so I tried various
> ways
> > to search google for them. For some reason the searching ended up being 
> a
> bit
> > frustrating. I guess the words ruby and camping are too common.  
> Unfortunately
> > the mailing list archives are not searchable either.
> >
> > So how do you craft your searches?  In my case I was looking for
> information on
> > how to handle migrations and how to use different views (not markaby).
> >
> > Cheers.
> 
> > ___
> > Camping-list mailing list
> > Camping-list@rubyforge.org
> > http://rubyforge.org/mailman/listinfo/camping-list
> 
> 
> --
>  Warning! 
> 100'000 pelos de escoba fueron
> introducidos satisfactoriamente
> en su puerto USB.
> 
> 
> 
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
> 
> 

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Would like some hints on best ways to search for camping questions.

2013-11-01 Thread låzaro
jusr now we hace a big problem with doc, but here in the mailing list you
will have all you answers. Also in the IRC channel #camping we could help
you. I'm  writing new doc about camping and need questions like yours, son
write me please, and I'll focus the doc via your questions.



Thread name: "Would like some hints on best ways to search for camping 
questions." 
Mail number: 1 
Date: Fri, Nov 01, 2013 
In reply to: Tim Uckun 
>
> Hello Campers.
> 
> On a whim I thought I would try to fool around with camping.   The
> documentation is nice and does a fine job of covering what it wants to cover
> but I needed some information not covered by the docs so I tried various ways
> to search google for them. For some reason the searching ended up being a bit
> frustrating. I guess the words ruby and camping are too common.   
> Unfortunately
> the mailing list archives are not searchable either.
> 
> So how do you craft your searches?  In my case I was looking for information 
> on
> how to handle migrations and how to use different views (not markaby).
> 
> Cheers.

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: Problems with sqlite3 and JRuby

2013-08-12 Thread låzaro
try:

module Nuts::Models

   # you JDB connection here
   DB=Sequel.connect "fulanito_connection"

   class Table < Sequel::Model(:table_name)
   end

end


Or use something AR related, it do not must raise any error. For example,
do not use the 

"< V 1.2" schema...



As long you dont say "Base" in anywhere, campign will not, call their AR
weird DB backend core. and do ont include Moldes in the controller (do no
use include sentence inside the Controllers module)

Main developer say, that "Models" is an empty Module, as long you no call
"Base" in any place...



Thread name: "Re: Problems with sqlite3 and JRuby" 
Mail number: 1 
Date: Mon, Aug 12, 2013 
In reply to: Thomas Seliger 
>
> I got further yesterday by patching camping so that it uses jdbcsqlite3.
> But I encountered another problem, which was Jruby+activerecord related.
> 
> It worked with native ruby but with Jruby I always got:
> 
>   Nuts::Models is not missing constant Base!
> 
>   Ruby
> /home/tom/.rbenv/versions/jruby-1.7.4/gemsets/ugcmanager/gems/activesupport-
>   4.0.0/lib/active_support/dependencies.rb: in load_missing_constant,
> line 448
> 
> I already thought about ditching AR for sequel, is there an easy (maybe
> someone did it already) way to replace AR with sequel in camping? I
> would like to retain the nice camping model features like db migration.
> 
> Anway thanks for the reply!
> Tom
> 
> 
> Am 12.08.2013 16:54, schrieb låzaro:
> > I suggest you to use sequel instead AR. The AR's support is patethic just
> > rigth now, due the Rails's changes.
> > 
> > http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html
> > 
> > 
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: Problems with sqlite3 and JRuby

2013-08-12 Thread låzaro
I suggest you to use sequel instead AR. The AR's support is patethic just
rigth now, due the Rails's changes.

http://sequel.rubyforge.org/rdoc/files/doc/opening_databases_rdoc.html


Thread name: "Problems with sqlite3 and JRuby" 
Mail number: 1 
Date: Sun, Aug 11, 2013 
In reply to: Thomas Seliger 
>
> Hello,
> 
> I am new to camping and I really like the zen of this framework. I would
> like to use it with Jruby and followed the instructions at
> http://camping.io/Camping-in-jRuby
> 
> But I am unsure, where I should put
> 
>   ActiveRecord::Base.establish_connection(
> :adapter => 'jdbcsqlite3',
> :database => "foo.sqlite3"
>   )
> 
> in the code.
> 
> I am doing my experiments with the simple example from the camping book,
> but I always get:
> 
>   Gem::LoadError at /
>   Specified 'sqlite3' for database adapter, but the gem is not loaded.
>   Add `gem 'sqlite3'` to your Gemfile.
> 
> No matter what I do, camping runs this part in lib/camping/server.rb
>   
> if !Camping::Models.autoload?(:Base) && options[:database]
>   Camping::Models::Base.establish_connection(...
> :adapter => 'sqlite3',
> :database => options[:database]
>   )
> end
> 
> Maybe you could point me into the right direction, I think that I am
> doing something wrong here.
> 
> Thanks!
> Tom
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: More crap from AR 4

2013-07-08 Thread låzaro
the github version break everything. Just now, the old warning this:

DEPRECATION WARNING: Database connections will not be closed automatically,
please close your database connection at the end of the thread by calling
`close` on your connection.  For example:
ActiveRecord::Base.connection.close

Do not allow work with AR-4, the databae just break the overflow after 4 o
5 request.

Options: Anchor in the version 3.x

A better option would be use Sequel, it have an very similar AR's like API




Thread name: "Re: More crap from AR 4" 
Mail number: 1 
Date: Mon, Jul 08, 2013 
In reply to: David C gurugeek 
>
> +1 for this. I suggest that we do not do anything to break bw compatibility. I
> am using camping in production and I would certainly not like to see all the
> code breaking at the next camping update... thanks
> David
> 
> On Jul 8, 2013, at 5:44 PM, Julik Tarkhanov  
> wrote:
> 
> 
> Maybe Camping should stick to AR3 then? at least until these are resolved?
> 
> On 7 jul. 2013, at 03:24, l zaro  wrote:
> 
> 
> Hi, all, now with AR-4 is imposible to add any relation
> 
> 
>
> --
> Julik Tarkhanov
> m...@julik.nl
> 
>
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
> 
> 

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: More crap from AR 4

2013-07-08 Thread låzaro
We could use squel, it is very sloid and AR like interface

http://sequel.rubyforge.org/rdoc/files/doc/active_record_rdoc.html


Thread name: "More crap from AR 4" 
Mail number: 1 
Date: Sat, Jul 06, 2013 
In reply to: låzaro 
>
> Hi, all, now with AR-4 is imposible to add any relation
> 
> I mean for example:
> 
> Blog.entries.new 
> 
> And you'll have a very weird erro. Do not happen the same thing when you do
> it in the console.
> 
> NO ONE application, work the Table.relation.new or Table.relation.create...
> 
> except in the console...
> 
> Could we move to datamapper???
> 
> 
> 
> ArgumentError at /estacion/pacientes/evolucionar/1
> 
> wrong number of arguments (1 for 2)
> 
> Ruby : in initialize, line 27
> Web  POST localhost/estacion/pacientes/evolucionar/1
> 
> Jump to:
> 
>   * GET
>   * POST
>   * Cookies
>   * ENV
> 
> Traceback (innermost first)
> 
>   * : in initialize
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:
>  in new
> 20. end
> 21. if (attrs = args.first).is_a?(Hash)
> 22. if subclass = subclass_from_attrs(attrs)
> 23. return subclass.new(*args, &block)
> 24. end
> 25. end
> 26. # Delegate to the original .new
> 27. super...
> 28. end
> 29.
> 30. # True if this isn't a concrete subclass needing a STI type condition.
> 31. def descends_from_active_record?
> 32. if self == Base
> 33. false
> 34. elsif superclass.abstract_class?
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:
>  in new
> 20. end
> 21. if (attrs = args.first).is_a?(Hash)
> 22. if subclass = subclass_from_attrs(attrs)
> 23. return subclass.new(*args, &block)
> 24. end
> 25. end
> 26. # Delegate to the original .new
> 27. super...
> 28. end
> 29.
> 30. # True if this isn't a concrete subclass needing a STI type condition.
> 31. def descends_from_active_record?
> 32. if self == Base
> 33. false
> 34. elsif superclass.abstract_class?
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/reflection.rb:
>  in build_association
> 182. super
> 183. @collection = [:has_many, :has_and_belongs_to_many].include?(macro)
> 184. end
> 185.
> 186. # Returns a new, unsaved instance of the associated class. 
> +attributes+ will
> 187. # be passed to the class's constructor.
> 188. def build_association(attributes, &block)
> 189. klass.new(attributes, &block)...
> 190. end
> 191.
> 192. def table_name
> 193. @table_name ||= klass.table_name
> 194. end
> 195.
> 196. def quoted_table_name
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/association.rb:
>  in build_record
> 235. # the target is stale.
> 236. #
> 237. # This is only relevant to certain associations, which is why it 
> returns nil by default.
> 238. def stale_state
> 239. end
> 240.
> 241. def build_record(attributes)
> 242. reflection.build_association(attributes) do |record|...
> 243. initialize_attributes(record)
> 244. end
> 245. end
> 246. end
> 247. end
> 248. end
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/collection_association.rb:
>  in build
> 107. first_or_last(:last, *args)
> 108. end
> 109.
> 110. def build(attributes = {}, &block)
> 111. if attributes.is_a?(Array)
> 112. attributes.collect { |attr| build(attr, &block) }
> 113. else
> 114. add_to_target(build_record(attributes)) do |record|...
> 115. yield(record) if block_given?
> 116. end
> 117. end
> 118. end
> 119.
> 120. def create(attributes = {}, &block)
> 121. create_record(attributes, &block)
>   * 
> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/collection_proxy.rb:
>  in build
> 222. # # #,
> 223. # # #
> 224. # # ]
> 225. #
> 226. # person.pets.size # => 5 # size of the collection
> 227. # person.pets.count # => 0 # count from database
> 228. def build(attributes = {}, &block)
> 229. @association.build(attributes, &block)...
> 230. end
> 231. alias_method :new, :build
> 232.
> 233. # Returns a new object of the collection type that has been 
> instantiated with
> 234. # attributes, linked to this 

More crap from AR 4

2013-07-08 Thread låzaro
Hi, all, now with AR-4 is imposible to add any relation

I mean for example:

Blog.entries.new 

And you'll have a very weird erro. Do not happen the same thing when you do
it in the console.

NO ONE application, work the Table.relation.new or Table.relation.create...

except in the console...

Could we move to datamapper???



ArgumentError at /estacion/pacientes/evolucionar/1

wrong number of arguments (1 for 2)

Ruby : in initialize, line 27
Web  POST localhost/estacion/pacientes/evolucionar/1

Jump to:

  * GET
  * POST
  * Cookies
  * ENV

Traceback (innermost first)

  * : in initialize
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:
 in new
20. end
21. if (attrs = args.first).is_a?(Hash)
22. if subclass = subclass_from_attrs(attrs)
23. return subclass.new(*args, &block)
24. end
25. end
26. # Delegate to the original .new
27. super...
28. end
29.
30. # True if this isn't a concrete subclass needing a STI type condition.
31. def descends_from_active_record?
32. if self == Base
33. false
34. elsif superclass.abstract_class?
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/inheritance.rb:
 in new
20. end
21. if (attrs = args.first).is_a?(Hash)
22. if subclass = subclass_from_attrs(attrs)
23. return subclass.new(*args, &block)
24. end
25. end
26. # Delegate to the original .new
27. super...
28. end
29.
30. # True if this isn't a concrete subclass needing a STI type condition.
31. def descends_from_active_record?
32. if self == Base
33. false
34. elsif superclass.abstract_class?
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/reflection.rb:
 in build_association
182. super
183. @collection = [:has_many, :has_and_belongs_to_many].include?(macro)
184. end
185.
186. # Returns a new, unsaved instance of the associated class. 
+attributes+ will
187. # be passed to the class's constructor.
188. def build_association(attributes, &block)
189. klass.new(attributes, &block)...
190. end
191.
192. def table_name
193. @table_name ||= klass.table_name
194. end
195.
196. def quoted_table_name
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/association.rb:
 in build_record
235. # the target is stale.
236. #
237. # This is only relevant to certain associations, which is why it 
returns nil by default.
238. def stale_state
239. end
240.
241. def build_record(attributes)
242. reflection.build_association(attributes) do |record|...
243. initialize_attributes(record)
244. end
245. end
246. end
247. end
248. end
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/collection_association.rb:
 in build
107. first_or_last(:last, *args)
108. end
109.
110. def build(attributes = {}, &block)
111. if attributes.is_a?(Array)
112. attributes.collect { |attr| build(attr, &block) }
113. else
114. add_to_target(build_record(attributes)) do |record|...
115. yield(record) if block_given?
116. end
117. end
118. end
119.
120. def create(attributes = {}, &block)
121. create_record(attributes, &block)
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/associations/collection_proxy.rb:
 in build
222. # # #,
223. # # #
224. # # ]
225. #
226. # person.pets.size # => 5 # size of the collection
227. # person.pets.count # => 0 # count from database
228. def build(attributes = {}, &block)
229. @association.build(attributes, &block)...
230. end
231. alias_method :new, :build
232.
233. # Returns a new object of the collection type that has been 
instantiated with
234. # attributes, linked to this object and that has already been saved 
(if it
235. # passes the validations).
236. #
  * hermes.rb: in post
1098. # el paciente viene del parametro dado
1099. @paciente=Paciente.find_by_cama paciente
1100.
1101. # validamos que este listo para evolucionar
1102. @fiebre=input.include? 'fiebre'
1103.
1104. # creamos el paciente nuevo
1105. @evolucion=@paciente.evoluciones.new 
:evolucion=>input.evolucion.to_s, :fiebre=>@fiebre,:senho=>@state[:realname]...
1106.
1107. @evolucion.save # muestrame como quedo
1108. redirect R(EstacionPacientesN,paciente)
1109.
1110. end # if
.
1112. end # post
  * : in block in service
  * : in catch
  * : in service
  * : in call
  * 
/usr/local/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/session/abstract/id.rb: 
in call
218.
219. def call(env)
220. context(env)
221. end
222.
223. def context(env, app=@app)
224. prepare_session(env)
225. status, headers, body = app.call(env)...

Re: migrations

2013-07-02 Thread låzaro
yes,yes, I did something like that.. thanks master ;)


Thread name: "Re: migrations" 
Mail number: 1 
Date: Mon, Jul 01, 2013 
In reply to: Kenneth Pullen 
>
> Lazaro,
> 
> I can't tell for sure what's going on without looking at your code, but I'm
> willing to bet you are defining the classes like so:
> 
>     class BasicFields < V 1.0
>         # some stuff
>     end
> 
>     class BasicFields < V 1.1
>         # some other stuff
>     end
> 
> Am I right? If so, then you're not having a problem with Camping at all - it's
> a problem with Ruby. Well, not really a problem, but more like a side effect.
> The second definition of BasicFields is trying to redefine the superclass of a
> defined class, and I'm not sure you can, or even would want to do that. An 
> easy
> solution to this issue is to just use a different, descriptive name for your
> migration class. Something like:
> 
>     class BasicFields < V 1.0
>     end
> 
>     class SomeFieldsMarketingSaidWeNeeded < V 1.1
>     end
> 
> 
> See? You are defining a class, but really just treat that class name as a
> descriptor for the purpose of your migration. It's not going to be used
> anywhere - you aren't really ever going to manually instantiate the migration,
> and Camping knows what to do.
> 
> If this isn't your problem, then I sincerely apologize for wasting your
> valuable time. Go get those little wheels!
> 
> <3 Ken
> 
> 
> On Fri, Jun 28, 2013 at 9:21 AM, Lázaro Armando  wrote:
> 
> Hi
> 
> I'm trying to add a column in to my model, just write a BasicFields V 1.1
> in to my models but when running camping it return this error
> 
> deisi.rb:722:in `': superclass mismatch for class
> BasicFields (TypeError)
>         from deisi.rb:688:in `'
>         from deisi.rb:15:in `'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/
> camping/reloader.rb:98:in `load'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/
> camping/reloader.rb:98:in `load_file'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/
> camping/reloader.rb:60:in `load_apps'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/
> camping/reloader.rb:124:in `reload!'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/
> camping/server.rb:134:in `start'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/
> server.rb:141:in `start'
>         from /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/bin/
> camping:9:in `'
>         from /usr/local/bin/camping:23:in `load'
>         from /usr/local/bin/camping:23:in `'
> 
> 
> That only happen if I have 1.0 and 1.1 declared, after delete 1.0 that
> error is banished
> 
> My question:
> 
> I must delete the old BasicFields class?
> 
> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
> 
> 

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Re: migrations

2013-07-02 Thread låzaro
I respondo to myslef, the problem was solved using diferent names in migrations 
class


Lázaro Armando grabbed a keyboard and wrote: 
>
> Hi
> 
> I'm trying to add a column in to my model, just write a BasicFields V 1.1
> in to my models but when running camping it return this error
> 
> deisi.rb:722:in `': superclass mismatch for class BasicFields 
> (TypeError)
> from deisi.rb:688:in `'
> from deisi.rb:15:in `'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/camping/reloader.rb:98:in
>  `load'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/camping/reloader.rb:98:in
>  `load_file'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/camping/reloader.rb:60:in
>  `load_apps'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/camping/reloader.rb:124:in
>  `reload!'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/lib/camping/server.rb:134:in
>  `start'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:141:in 
> `start'
> from 
> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1.532/bin/camping:9:in ` (required)>'
> from /usr/local/bin/camping:23:in `load'
> from /usr/local/bin/camping:23:in `'
> 
> 
> That only happen if I have 1.0 and 1.1 declared, after delete 1.0 that error 
> is banished
> 
> My question:
> 
> I must delete the old BasicFields class?

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


ActiveRecord 4 posible bug

2013-07-02 Thread låzaro
hi, this look like a bug. Version ago I seen something about close database
connection but now, the connection "fade". Just leave the page loaded 5
minutes or more and it become Timeout

ActiveRecord::ConnectionTimeoutError at /detalles
could not obtain a database connection within 5.000 seconds (waited 5.000 
seconds)
Ruby 
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/
connection_pool.rb: in block in wait_poll, line 190

___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


Re: mounting multiples app

2013-05-24 Thread låzaro
I'll try it... thanks

Thread name: "Re: mounting multiples app" 
Mail number: 1 
Date: Wed, May 22, 2013 
In reply to: David Susco 
>
> That will allow you to host two apps via a single config file. To separate out
> your MVCs, try this:
> 
> -- myapp.rb --
> 
> %w(camping).each { |lib| require lib }
> 
> Camping.goes :MyApp
> 
> %w(helpers models views controllers).each { |lib| require lib }
> 
> module MyApp
> ...
> end
> 
> -- models.rb --
> 
> module MyApp::Models
> ...
> end
> 
> -- --
> 
> And so on for helpers.rb, views.rb and controllers.rb

> ___
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


-- 
 Warning! 
100'000 pelos de escoba fueron
introducidos satisfactoriamente
en su puerto USB.




___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list


mounting multiples app

2013-05-22 Thread låzaro
Hi, I trying to mount an App but with separetaed model, controller and
view in otrher files. Waht could I do? How these files must be?
___
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list