mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Add AR integration tests
This commit is contained in:
13
test/fixtures/active_record.rb
vendored
13
test/fixtures/active_record.rb
vendored
@@ -6,15 +6,16 @@ ActiveRecord::Base.establish_connection(
|
||||
)
|
||||
|
||||
ActiveRecord::Schema.define do
|
||||
create_table :ar_models, :force => true do |t|
|
||||
t.string :attr1
|
||||
t.string :attr2
|
||||
create_table :ar_profiles, :force => true do |t|
|
||||
t.string :name
|
||||
t.string :description
|
||||
t.string :comments
|
||||
end
|
||||
end
|
||||
|
||||
class ARModel < ActiveRecord::Base
|
||||
class ARProfile < ActiveRecord::Base
|
||||
end
|
||||
|
||||
class ARModelSerializer < ActiveModel::Serializer
|
||||
attributes :attr1, :attr2
|
||||
class ARProfileSerializer < ActiveModel::Serializer
|
||||
attributes :name, :description
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user