diff --git a/README b/README index 729103f..5bfd11f 100644 --- a/README +++ b/README @@ -2,4 +2,10 @@ For guidance and usage examples, visit: http://forge.kayako.com/projects/kayako-ruby-api-library For help and support from the Kayako developer community, visit: -http://forums.kayako.com/ \ No newline at end of file +http://forums.kayako.com/ + + +In this there is some major changes related to download of attachment. +It is compatible with ruby 1.9.x. + +As in higher version of ruby there is a support for encodings this issue has been solved in this commit. \ No newline at end of file diff --git a/lib/kayako_client/mixins/attachment.rb b/lib/kayako_client/mixins/attachment.rb index 8a38500..a2a57c1 100644 --- a/lib/kayako_client/mixins/attachment.rb +++ b/lib/kayako_client/mixins/attachment.rb @@ -55,7 +55,8 @@ def file @file elsif contents raise RuntimeError, "not a remote file" unless id && !new? - @file = Tempfile.new(file_name.split('.').first || 'kayako_attachment') + @file = Tempfile.new([file_name.split('.').first || 'kayako_attachment', "."+file_name.split('.').last]) + @file.binmode @file.write(contents) @file.flush @file.rewind diff --git a/lib/kayako_client/user.rb b/lib/kayako_client/user.rb index e4ea021..55e304c 100644 --- a/lib/kayako_client/user.rb +++ b/lib/kayako_client/user.rb @@ -26,7 +26,7 @@ class User < KayakoClient::Base property :enable_dst, :boolean property :sla_plan_id, :integer property :sla_plan_expiry, :date - property :password, :string, :new => true, :required => :post + property :password, :string, :required => :post property :send_welcome_email, :boolean, :new => true associate :user_group, :user_group_id, UserGroup