I hereby claim:
- I am rsierra on github.
- I am maguilag (https://keybase.io/maguilag) on keybase.
- I have a public key ASCtAwIhv_ptYAJYUjHMK68lREQu6PIrUb7WgRRXFM4Rego
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| en: | |
| errors: | |
| messages: | |
| lock: can't be changed |
| if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".ruby-version" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".ruby-gemset" ]; then | |
| rvm use `cat .ruby-version`@`cat .ruby-gemset` | |
| else | |
| rvm use `cat .ruby-version` | |
| fi | |
| fi |
Module to use similar model multiple params assignment and dates with multiparams (params["date(1i)"], params["date(2i)"], params["date(3i)"]) in a non ActiveModel class.
class Sample
include ActiveModel::Multiassignment
attr_accessor :name, :date
multiparameter_dates :date
Extracted from official patchs.
To test the JSON parser (CVE-2013-0269), try to parse a malicious json:
To test the parser, try to decode with a bad formatted json: (I don't know if it's the best test, but you check if you are using the json parser in the rails 2.3 official patch)
| # Adapted patch for CVE-2012-2695 Ruby on Rails SQL Injection for rails 2.1.x versinos | |
| # http://seclists.org/oss-sec/2012/q2/att-504/2-3-sql-injection.patch | |
| # 1- Drop it at your_app/config/initializers/ | |
| # 2- Remember to pass your tests/specs | |
| # 3- Profit! | |
| module ActiveRecord | |
| class Base | |
| class << self |
| set autolist | |
| set autoeval | |
| set autoreload |
| module Gmaps4rails | |
| module ActsAsGmappable | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| module InstanceMethods | |
| # This is a before_filter to trigger the geocoding and save its results |
| // Preferences -> Key Bindings - User | |
| [ | |
| // Key for ERB Insert and Toggle Commands package | |
| { "keys": ["ctrl+shift+<"], "command": "erb" } | |
| ] |