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
| field_naming_convention = lambda do |v| | |
| if v.name.to_s[0..0] == v.name[0..0].to_s.upcase | |
| DataMapper::NamingConventions::Field::Underscored(v) | |
| else | |
| v.name.to_s | |
| 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
| # workaround from | |
| # http://stackoverflow.com/questions/1987386/foreign-key-name-in-datamapper-associations | |
| field_naming_convention = lambda do |v| | |
| if v.name.to_s[0..0] == v.name.to_s[0..0].upcase | |
| v.name.to_s | |
| else | |
| DataMapper::NamingConventions::Field::Underscored.call(v) | |
| 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
| INFO = <<HERE | |
| TABLES: | |
| gds | |
| - key gds | |
| gse | |
| - key gse | |
| gds_gse | |
| - key gds | |
| - int gse |
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
| require "dm-core" | |
| require "dm-timestamps" | |
| # Note, a GSE etc could have two of the same field (i.e. Pubmed so check for that | |
| # and make an array instead) | |
| # GDS | |
| # has 1 GSE | |
| # has n GDSSubsets | |
| # GDSSubset |
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
| require "dm-core" | |
| require "dm-timestamps" | |
| # Note, a GSE etc could have two of the same field (i.e. Pubmed so check for that | |
| # and make an array instead) | |
| # child_key: set of fields identifying child model | |
| # parent_key: set of fields identifying parent model | |
| # GDS |
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
| require "dm-core" | |
| require "dm-timestamps" | |
| # Note, a GSE etc could have two of the same field (i.e. Pubmed so check for that | |
| # and make an array instead) | |
| # child_key: set of fields identifying child model | |
| # parent_key: set of fields identifying parent model | |
| # GDS |
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 GEO | |
| def self.inherited(subclass) | |
| subclass.class_eval do | |
| include DataMapper::Resource | |
| def self.default_repository_name; :expr_geo; end | |
| end | |
| end | |
| end | |
| class GDS < GEO |
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
| require "dm-core" | |
| require "dm-timestamps" | |
| module GORM | |
| class GEO | |
| def self.inherited(subclass) | |
| subclass.class_eval do | |
| include DataMapper::Resource | |
| def self.default_repository_name; :expr_geo; 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
| ~ Unknown column 'gse_gsm.gse_gse' in 'where clause' (code: 1054, sql state: 42S22, query: SELECT `gsm_list`.`gsm` FROM `gsm_list` INNER JOIN `gse_gsm` ON `gsm_list`.`gsm` = `gse_gsm`.`gsm` INNER JOIN `gse_list` ON `gse_gsm`.`gse_gse` = `gse_list`.`gse` WHERE `gse_gsm`.`gse_gse` = 1 GROUP BY `gsm_list`.`gsm` ORDER BY `gsm_list`.`gsm`, uri: mysql://rpt:rpt@bmir-db1.sunet/expr_geo) | |
| DataObjects::SQLError: Unknown column 'gse_gsm.gse_gse' in 'where clause' (code: 1054, sql state: 42S22, query: SELECT `gsm_list`.`gsm` FROM `gsm_list` INNER JOIN `gse_gsm` ON `gsm_list`.`gsm` = `gse_gsm`.`gsm` INNER JOIN `gse_list` ON `gse_gsm`.`gse_gse` = `gse_list`.`gse` WHERE `gse_gsm`.`gse_gse` = 1 GROUP BY `gsm_list`.`gsm` ORDER BY `gsm_list`.`gsm`, uri: mysql://rpt:rpt@bmir-db1.sunet/expr_geo) |
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
| require "dm-core" | |
| require "dm-timestamps" | |
| # Note, a GSE etc could have two of the same field (i.e. Pubmed so check for that | |
| # and make an array instead) | |
| # child_key: set of fields identifying child model | |
| # parent_key: set of fields identifying parent model | |
| # GDS |