When pass :cache param to ActionDispatch::Session::MemCacheStore, it should
be removed from options, otherwise it remains "published". This violates the
OOP encapsulation principle.
I created a LH ticket with a patch
http://bit.ly/cGDaWs
Luca
--
lucaguidi.com
twitter.com/jodosha
--
You receive
You can safely use Passenger with Ruby 1.9.1, avoiding REE.
- Luca
--
lucaguidi.com
twitter.com/jodosha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email
The EY team will maintain 1.8.x branch only for security issues, I don't
think they will backport all the 1.9.x features. Because it's a non-sense.
The present (not the future) of Ruby it's 1.9.1, honestly don't know why the
majority (myself included) is still on the old-and-beloved 1.8.6.
The "Bi
Agree with Francesc
--
lucaguidi.com
twitter.com/jodosha
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscr
I don't know if this may help, but a couple of years ago I wrote a plugin in
order to unify AR and ARes behaviors in one class:
http://github.com/jodosha/acts-as-resource/tree/master
class Carrot
acts_as_resource
self.site = "http://api.example.com";
belongs_to :bunny
valdates_presence_of
Just updated the benchmark (http://gist.github.com/163274), tried to solve
the issue using #any? instead of #try, but isn't fast for filled arrays:
module Enumerable
def else
not any? ? yield : self # don't try this at home
end
end
Luca
--
lucaguidi.com
twitter.com/jodosha
--~--~
What about using Object#try and avoiding the explicit &block argument?This
avoid to instantiate a Proc object *for each* method execution, if any block
isn't passed and the enumerable is empty the VM will raise a LocalJumpError.
module Enumerable
def else
self.try(:empty?) ? yield : self
e
The current bytes calculation is inefficient, because every time it
instantiate a Fixnum (1024) and generates a lot of method calls.
Example: if I call 16.gigabytes it internally invokes megabyte and
kilobyte, instantiating three times 1024.
The number of internal calls and Fixnum instantiatio
Hi,
May I suggest this one?
http://rails.lighthouseapp.com/projects/8994/tickets/2251
Please look at the bottom of the comments list, my patch has spotlighted
another bug, but the resolution is controversy, due to opposite
behaviors allowed to the hmt association.
I found a TODO in the concer
Hi, just gave a look at your code, the problem is trivial: you shouldn't
call both #update_attributes *and* #save, because they performs the same
operation. The former is a syntax shortcut:
person.name = "luca"
person.age = 26
person.save
# or
person.update_attributes :name => "luca", :age =>
Hi, please can you specify which version of Rails are you currently
using, and an example of the code that causes your problem?
I tried to reproduce it with:
compra.update_attributes :detalle_de_compras_attributes => [{:id =>
953125641, :_delete => true}]
but works fine for me, it decrements t
Hi Ryan, glad you like my proposal.
I implemented all the changes mentioned in my last email, only
#assign_attributes is pending. http://bit.ly/1wSmS
Few considerations:
* I implemented #protect_from_mass_assignment at class level, instead of
a top-level ActiveRecord flag, because gives a fine
Assumptions:
- attr_accessible/attr_protected aren't used because coders often
forget about those macros, and also because they are annoying to work
with. The current API doesn't encourage them.
- attr_protected is dangerous (rails-spikes.com)
- Protection should be at class level
- Controllers sh
Hi Ben,
I guess you are going to create an order on the remote service, why
don't you use ActiveResource in the following way?
class Order < ActiveResource::Base
self.site = "http://api.example.com";
headers["X-TheRequiredApplicationKey"] =
"ThisIsAReallyGreatApplicationKey"
headers["
All the methods in ActiveRecord::SessionStore::SqlBypass use
@@connection class var, instead of the homonym class method. This of
course doesn't not guarantee that var isn't nil.
Try it by yourself:
# config/initializers/session_store.rb
ActionController::Base.session_store = :active_record_store
class Person < ActiveRecord::Base
has_many :emails, :after_remove => :set_preferred_email
accepts_nested_attributes_for :emails, :allow_destroy => true
private
def set_preferred_email
# ...
end
end
person.emails.delete(email) # => it run the callback
person.update_att
This patch adds two tasks:
* db:migrate:engines
* db:migrate:engines:down
The first one allows to run all the migrations stored in the db/migrate
directory of each plugin.
It runs migrations in the same order Rails::Initializer register the
plugins, this means if you force an order by env
I'm using Ruby 1.9.1-rc2 (ruby 1.9.1p0 (2009-01-20 revision 21700)
[i386-darwin9.5.0]) and trying to run unit tests for AS.
I noticed an endless loop for all the cases which are using XmlMini,
which is autoloaded:
autoload :XmlMini, 'active_support/xml_mini'
Autoload expect to find ActiveSupport
Rails.cache.write returns false with MemCacheStore even if the operation
was successful done.
result = Rails.cache.write('key', 'value')
Rails.cache.read('key') # => value
puts result # => false
The problem is trivial: MemCache#set doesn't return any result, so the
check performed by MemCacheSto
Hi all,
I noticed a strange behavior with Memcached store.
The first time I store an model object, Memcached correctly store the
timestamps, using the configured time zone (UTC for me).
When I update that object and cache it again, Memcached uses the server
local time for the updated_at attribute
Hi all,
I found a strange behaviour in eager loading:
class Category < ActiveRecord::Base
has_and_belongs_to_many :movies
has_and_belongs_to_many :most_recent_movies, :class_name => 'Movie',
:order => 'created_at DESC', :limit => 10
end
class Movie < ActiveRecord::Base
has_and_belongs_
Hi Lawrence,
I experienced the same issue, of course camelize doesn't work properly,
but just add the following two lines to the plugin init.rb I can run Rails:
require File.dirname(__FILE__) + '/lib/authorization'
require File.dirname(__FILE__) + '/lib/authorization/stateful_roles'
I didn't i
I have developed an high level extension for Globalize, for inplace
translations of views, via ajax.
You can find a guide, tips, video tutorials and more, at the related
page: http://www.lucaguidi.com/pages/click-to-globalize
I hope this is useful for your purposes.
Luca.
--
blog: www.lucagui
Josh Susser wrote:
> In the meantime, this seems to work:
>
> gem install rails --source http://gems.rubyonrails.org
Notice the missing platform.
$ sudo gem update rails --source http://gems.rubyonrails.org
Password:
Updating installed gems...
Attempting remote update of rails
Select which ge
24 matches
Mail list logo