Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.max_allowed_packet
- r = connection.execute "SHOW GLOBAL VARIABLES LIKE 'max_allowed_packet'"
- r.fetch_row.last.to_i rescue 128.megabytes
- end
- validates_length_of :data, :in => 1 .. max_allowed_packet,
- :allow_blank => true
- validates_length_of :file, :in => 1 .. max_allowed_packet,
- :allow_blank => true
Add Comment
Please, Sign In to add comment