Module: ActiveMocker::MockCreator::Attributes

Included in:
ClassMethods
Defined in:
lib/active_mocker/mock_creator.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



161
162
163
164
165
166
167
168
169
# File 'lib/active_mocker/mock_creator.rb', line 161

def attributes
  @attribute ||= begin
    a = schema_scrapper.attributes.to_a
    unless a.any? { |aa| aa.name == "id" }
      a << primary_key
    end
    a
  end
end