Skip to content

Instantly share code, notes, and snippets.

@enovajuan
Created February 9, 2015 22:05
Show Gist options
  • Save enovajuan/d86a7aecab1306dc3d9d to your computer and use it in GitHub Desktop.
Save enovajuan/d86a7aecab1306dc3d9d to your computer and use it in GitHub Desktop.
Lookup Initializers stuff
dodo = CreditReportField.new
Creating a lookup for: credit_report_field_type
Creating a class_eval lookup for: credit_report_field_type
doing something crazy for all methods: []
CreditReportFieldType Load (0.7ms) SELECT "credit_report_field_types".* FROM "credit_report_field_types" ORDER BY "credit_report_field_types"."credit_report_field_type" ASC
CreditReportFieldType Load Cache All (12.5ms)
Creating a lookup for: credit_report_field
Creating a class_eval lookup for: credit_report_field
doing something crazy for all methods: []
CreditReportField Load (29.9ms) SELECT "credit_report_fields".* FROM "credit_report_fields" ORDER BY "credit_report_fields"."credit_report_field" ASC
CreditReportField Load Cache All (111.0ms)
#<CreditReportField credit_report_field_id: nil, credit_report_type_id: nil, credit_report_field: nil, xpath: nil, credit_report_field_type_id: 1>
>>
>> CreditReportField.by_report_type(1)
doing something crazy for all methods: []
Creating a lookup for: credit_report_type
Creating a class_eval lookup for: credit_report_type
doing something crazy for all methods: []
doing something crazy for all methods: []
CreditReportType Load (0.4ms) SELECT "credit_report_types".* FROM "credit_report_types" ORDER BY "credit_report_types"."credit_report_type" ASC
CreditReportType Load Cache All (4.3ms)
CreditReportField Load (0.4ms) SELECT "credit_report_fields".* FROM "credit_report_fields" WHERE "credit_report_fields"."credit_report_type_id" = 1
#<ActiveRecord::Relation [#<CreditReportField credit_report_field_id: 1, credit_report_type_id: 1, credit_report_field: "risk_codes", xpath: nil, credit_report_field_type_id: 6>, #<CreditReportField credit_report_field_id: 3, credit_report_type_id: 1, credit_report_field: "curr_addr_applicant_owned", xpath: "string(//xmlns:Attribute[xmlns:Name='CurrAddrAppli...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 4, credit_report_type_id: 1, credit_report_field: "input_addr_applicant_owned", xpath: "string(//xmlns:Attribute[xmlns:Name='InputAddrAppl...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 5, credit_report_type_id: 1, credit_report_field: "invalid_dl", xpath: "string(//xmlns:Attribute[xmlns:Name='InvalidDL']/x...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 6, credit_report_type_id: 1, credit_report_field: "recent_update", xpath: "string(//xmlns:Attribute[xmlns:Name='RecentUpdate'...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 7, credit_report_type_id: 1, credit_report_field: "addr_stability", xpath: "string(//xmlns:Attribute[xmlns:Name='AddrStability...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 8, credit_report_type_id: 1, credit_report_field: "bankruptcy_count_03", xpath: "string(//xmlns:Attribute[xmlns:Name='BankruptcyCou...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 9, credit_report_type_id: 1, credit_report_field: "curr_addr_last_sales_price", xpath: "string(//xmlns:Attribute[xmlns:Name='CurrAddrLastS...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 10, credit_report_type_id: 1, credit_report_field: "eviction_count", xpath: "string(//xmlns:Attribute[xmlns:Name='EvictionCount...", credit_report_field_type_id: 3>, #<CreditReportField credit_report_field_id: 11, credit_report_type_id: 1, credit_report_field: "prof_lic_count", xpath: "string(//xmlns:Attribute[xmlns:Name='ProfLicCount'...", credit_report_field_type_id: 3>, ...]>
>> CreditReportField.named("jessus")
doing something crazy for all methods: []
doing something crazy for all methods: []
CreditReportField Load (11.2ms) SELECT "credit_report_fields".* FROM "credit_report_fields" WHERE "credit_report_fields"."credit_report_field" = 'jessus' [["credit_report_field", "jessus"]]
#<ActiveRecord::Relation []>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment