
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
paperclip-globalize3
Advanced tools
Use locale-specific attachments in your Rails app with paperclip and globalize.
You can transparently read and write your attachments in context of the current locale. E.g. my_model.my_attachment
returns a different attachment when your current locale is 'en' compared to when your current locale is 'de'.
Note that this implementation patches some methods in the Paperclip::Attachment
class, so make sure you are okay with that.
Rails 5.2 and later are only tested with paperclip 6.1 (see .travis.yml
for details).
For support of previous paperclip / globalize / rails versions please refer to the 3.x versions of this gem.
Since paperclip itself has been deprecated and we currently do not use this gem in active projects any more, further development of this gem (e.g. compatibility with Rails 7.0) is unlikely. If anyone wants to submit a PR, we will of course still try to review + merge.
Add this line to your application's Gemfile:
gem 'paperclip-globalize3'
And then execute:
$ bundle
Or install it yourself as:
$ gem install paperclip-globalize3
For each of your attachments which should have support for different locales, set up the following:
NOTE: Make sure your translates
are always defined after the has_attached_file
! (Otherwise the files will not be deleted from the filesystem when the model is destroyed.)
Example:
class User < ActiveRecord::Base
has_attached_file :avatar,
:url => "/system/:attachment/:id/:locale/:style-:fingerprint.:extension"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
translates :avatar_file_name, :avatar_file_size, :avatar_created_at, :avatar_updated_at, :avatar_fingerprint
end
To setup tests, make sure all the ruby versions defined in .travis.yml
are installed on your system.
Run tests via:
rake wwtd
for all combinations of ruby/rails/paperclip versions (NOTE that when using rake wwtd:parallel
there
might be some flickering test failures - needs to be investigated)rake wwtd:local
for all rails/paperclip versions, but only on current rubyrake spec
(or e.g. bundle exec rspec spec --format documentation
) with main Gemfile and only on current rubygit checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that paperclip-globalize3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.