mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Add AMS support to AR objects
This commit is contained in:
20
test/fixtures/active_record.rb
vendored
Normal file
20
test/fixtures/active_record.rb
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'active_record'
|
||||
|
||||
ActiveRecord::Base.establish_connection(
|
||||
:adapter => 'sqlite3',
|
||||
:database => ':memory:'
|
||||
)
|
||||
|
||||
ActiveRecord::Schema.define do
|
||||
create_table :ar_models, :force => true do |t|
|
||||
t.string :attr1
|
||||
t.string :attr2
|
||||
end
|
||||
end
|
||||
|
||||
class ARModel < ActiveRecord::Base
|
||||
end
|
||||
|
||||
class ARModelSerializer < ActiveModel::Serializer
|
||||
attributes :attr1, :attr2
|
||||
end
|
||||
Reference in New Issue
Block a user