This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generate_mysql_hash(password) | |
| # pouze pokud bezime na MySQL | |
| if ActiveRecord::Base.connection.adapter_name == "MySQL" then | |
| # prohnat sql cistici funkci proti sql_injection | |
| parameters = ActiveRecord::Base.send :sanitize_sql_array, ["password('%s')", password] | |
| ActiveRecord::Base.connection.execute("select #{parameters}").fetch_row.first | |
| else | |
| password | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cares type="array"> | |
| <care> | |
| <name>asdfasdfafds</name> | |
| <original-id type="integer" nil="true"/> | |
| <created-at type="datetime">2011-07-05T17:28:57Z</created-at> | |
| <updated-at type="datetime">2011-07-05T17:30:18Z</updated-at> | |
| <id type="integer">1</id> | |
| <short-name>adsfasdf</short-name> | |
| <description nil="true"/> | |
| <rates-string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| line = "<p>aaa bbb ccc <abbr title=\"AUTHOR:5\">toto je autor</abbr> ddd eee fff <abbr title=\"WORK:10\">toto je jeho dilo</abbr></p>" | |
| regexp = /<abbr title=\"(.*?):(.*?)\">(.*?)<\/abbr>/ | |
| line.scan(regexp) | |
| # => [["AUTHOR", "5", "toto je autor"], ["WORK", "10", "toto je jeho dilo"]] |
OlderNewer