Commit fb658e907a24a82df63b51c3d7b2cf801658bea9
Committed by
Antonio Terceiro
1 parent
1e60d6cf
Exists in
master
and in
23 other branches
ActionItem1003: fixing sqlite extension for debian squeeze
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
lib/sqlite_extension.rb
| ... | ... | @@ -2,19 +2,19 @@ if ActiveRecord::Base.connection.adapter_name.downcase == 'sqlite' |
| 2 | 2 | |
| 3 | 3 | database = ActiveRecord::Base.connection.raw_connection |
| 4 | 4 | |
| 5 | - database.create_function('pow', 2, :numeric) do |func, base, exponent| | |
| 5 | + database.create_function('pow', 2, 1) do |func, base, exponent| | |
| 6 | 6 | func.set_result(base.to_f ** exponent.to_f) |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | - database.create_function('sqrt', 1, :numeric) do |func, value| | |
| 9 | + database.create_function('sqrt', 1, 1) do |func, value| | |
| 10 | 10 | func.set_result(Math.sqrt(value)) |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | - database.create_function('radians', 1, :numeric) do |func, value| | |
| 13 | + database.create_function('radians', 1, 1) do |func, value| | |
| 14 | 14 | func.set_result(value.to_f * Math::PI / 180.0) |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | - database.create_function('spheric_distance', 5, :real) do |func, lat1, long1, lat2, long2, radius| | |
| 17 | + database.create_function('spheric_distance', 5, 1) do |func, lat1, long1, lat2, long2, radius| | |
| 18 | 18 | func.set_result( |
| 19 | 19 | radius.to_f * Math.acos( |
| 20 | 20 | [1, | ... | ... |
vendor/plugins/geokit/lib/geo_kit/sqlite_extension.rb
| ... | ... | @@ -2,19 +2,19 @@ if ActiveRecord::Base.connection.adapter_name =~ /^sqlite$/i |
| 2 | 2 | |
| 3 | 3 | database = ActiveRecord::Base.connection.raw_connection |
| 4 | 4 | |
| 5 | - database.create_function('pow', 2, :numeric) do |func, base, exponent| | |
| 5 | + database.create_function('pow', 2, 1) do |func, base, exponent| | |
| 6 | 6 | func.set_result(base.to_f ** exponent.to_f) |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | - database.create_function('sqrt', 1, :numeric) do |func, value| | |
| 9 | + database.create_function('sqrt', 1, 1) do |func, value| | |
| 10 | 10 | func.set_result(Math.sqrt(value)) |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | - database.create_function('radians', 1, :numeric) do |func, value| | |
| 13 | + database.create_function('radians', 1, 1) do |func, value| | |
| 14 | 14 | func.set_result(value.to_f * Math::PI / 180.0) |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | - database.create_function('spheric_distance', 5, :real) do |func, lat1, long1, lat2, long2, radius| | |
| 17 | + database.create_function('spheric_distance', 5, 1) do |func, lat1, long1, lat2, long2, radius| | |
| 18 | 18 | func.set_result( |
| 19 | 19 | radius.to_f * Math.acos( |
| 20 | 20 | [1, | ... | ... |