Skip to content
Browse files

removed non_column_id_field in favor of type-based handling

  • Loading branch information...
1 parent 05193a8 commit f4ce1b77548bad425230063c66a61ed802c40295 @chrisjwu chrisjwu committed Feb 16, 2012
Showing with 2 additions and 7 deletions.
  1. +2 −6 lib/model_set.rb
  2. +0 −1 lib/model_set/query.rb
View
8 lib/model_set.rb
@@ -550,7 +550,7 @@ def self.table_name(table_name = nil)
def self.id_field(id_field = nil)
if id_field.nil?
- @id_field ||= 'id'
+ @id_field ||= :id
else
@id_field = id_field
end
@@ -564,12 +564,8 @@ def self.id_type(id_type = nil)
end
end
- def self.non_column_id_field(non_column_id_field = false)
- @non_column_id_field ||= non_column_id_field
- end
-
def self.id_field_with_prefix
- self.non_column_id_field ? self.id_field.to_s : "#{self.table_name}.#{self.id_field}"
+ self.id_field.is_a?(String) ? self.id_field : "#{self.table_name}.#{self.id_field}"
end
# Define instance methods based on class methods.
View
1 lib/model_set/query.rb
@@ -58,7 +58,6 @@ def clear_cache!
attr_reader :set_class
delegate :id_field, :to => :set_class
- delegate :non_column_id_field, :to => :set_class
delegate :id_field_with_prefix, :to => :set_class
def model_class

0 comments on commit f4ce1b7

Please sign in to comment.
Something went wrong with that request. Please try again.