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
| [{"value"=>"10", "parameter_id"=>"14"}, {"value"=>"2", "parameter_id"=>"14"}] |
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
| AVAILABLE_LOCALES = Dir.new(LOCALES_DIRECTORY).entries.collect {|x| x =~ /\.yml/ ? x.sub(/\.yml/,"") : nil }.compact.each_with_object({}) { |str, hsh| hsh[str] = YAML.load_file(LOCALES_DIRECTORY+str+".yml")[str]["this_file_language"] }.freeze |
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
| class Patient < ActiveRecord::Base | |
| has_many :documents | |
| has_many :reports, :through => :documents do | |
| def find_for_parameter(parameter) | |
| # report hm parameters | |
| find(:all, :joins => :parameters, :conditions => ['parameters.id = ?', parameter.id]) | |
| end | |
| end | |
| # @patient.reports.find_for_parameter(Parameter.first) |
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
| class Report < ActiveRecord::Base | |
| has_many :report_reasons | |
| has_many :reasons, :through => :report_reasons | |
| validates_associated :reasons | |
| end | |
| class Reason < ActiveRecord::Base | |
| has_many :report_reasons | |
| has_many :reports, :through => :report_reasons |
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 self.available_languages_codes | |
| codes = [] | |
| available_languages_columns.each do |column| | |
| codes << column.to_s.gsub(/content_/, '') | |
| end | |
| codes | |
| 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
| has_many :documents, :through => :contributions, :select => "documents.*, join_table.rich_attribute" do | |
| def push_with_attributes(document, rich_join_attrs) | |
| Contribution.send(:with_scope, :create => rich_join_attrs) { self << document } | |
| 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>KeepAlive</key> | |
| <true /> | |
| <key>Label</key> | |
| <string>com.mysql.mysqld</string> | |
| <key>Program</key> | |
| <string>/usr/local/mysql/bin/mysqld_safe</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
| def browse | |
| root, dir = File.expand_path("."), request[:dir] | |
| @lis = [] | |
| begin | |
| path = root + "/" + dir | |
| Dir.chdir(File.expand_path(path)) do | |
| if Dir.pwd[0,root.length] == root then | |
| files = Dir.glob("*") | |
| files.each{ |x| | |
| next unless File.directory?(x) |
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
| diff --git a/Rakefile b/Rakefile | |
| index 3bb0e85..d3133a3 100644 | |
| --- a/Rakefile | |
| +++ b/Rakefile | |
| @@ -8,3 +8,9 @@ require 'rake/testtask' | |
| require 'rake/rdoctask' | |
| require 'tasks/rails' | |
| + | |
| +# temporary work around for |
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
| # Rename an email address in all old commits. | |
| # WARNING: Will change all your commit SHA1s. | |
| # Based off of the script from here: | |
| # http://coffee.geek.nz/how-change-author-git.html | |
| git filter-branch -f --commit-filter ' | |
| if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ]; | |
| then | |
| GIT_AUTHOR_EMAIL="[email protected]"; | |
| GIT_COMMITTER_EMAIL="[email protected]"; | |
| git commit-tree "$@"; |