botvector.net domain for sale $2k usd (negotiable). Em@il me t0: alex DOT creopolis at gmail DOT com

My Git activity

Showing posts with label fix. Show all posts
Showing posts with label fix. Show all posts

13 May 2008

Globalize in Rails 2.0 BUG

Using Globalize is great, however if you planning / using Globalize (ModelTranslation) in application with Rails 2.0 you may impair this problem:
Argument error "wrong number of arguments (2 for 1)
while you updating your model data, like @order.update_attributes(params[:order])

All what you need to do is go to /vendor/plugins/globalize/lib/globalize/localization directory, open db_translate.rb file, goto line ~675 (of find def attributes_with_quotes method)
and replace whole def with that:


def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true)
if Locale.base?
quoted = attributes.inject({}) do |quoted, (name, value)|
if column = column_for_attribute(name)
quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
end
quoted
end
else
quoted = attributes.inject({}) do |quoted, (name, value)|
if !self.class.globalize_facets_hash.has_key?(name) &&
column = column_for_attribute(name)
quoted[name] = quote_value(value, column) unless !include_primary_key && column.primary
end
quoted
end
end
include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
end


Original fix by artemv

20 September 2007

Painless PNG plugin MOD

Thru the pains of PNG in (IE <img>'ing png icons..

First i've started from HERE.
Go here and read some instructions that are simple ( i dont want to repost them here!)

I've been uploaded updated painless_png.zip completely modified and working to my blog.
With this modifications (by Naixn and some by me) you *dont* need any modification to your css/html/ruby code.

1.Unpack content of ZIP into vendor/plugin
2.Copy blank.gif from ZIP to public/images.

Restart server and enjoy !

DOWNLOAD HERE