Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add isRaw to Query annotation #315

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'develop' of https://github.com/vitusortner/floor into d…
…evelop
  • Loading branch information
joshuatam committed Apr 17, 2020
commit 61c77679eb21c17a15f17f7d7ff8bfb4f49a44b7
7 changes: 4 additions & 3 deletions floor_generator/lib/processor/dao_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ class DaoProcessor extends Processor<Dao> {
@override
Dao process() {
final name = _classElement.displayName;
final supertypeMethods =
_classElement.allSupertypes.expand((type) => type.methods);
final methods = [..._classElement.methods, ...supertypeMethods];
final methods = [
..._classElement.methods,
..._classElement.allSupertypes.expand((type) => type.methods)
];

final queryMethods = _getQueryMethods(methods);
final insertionMethods = _getInsertionMethods(methods);
Expand Down
27 changes: 16 additions & 11 deletions floor_generator/test/processor/dao_processor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ void main() {
}
''');

final actual =
DaoProcessor(classElement, '', '', entities).process().methodsLength;
final actual = DaoProcessor(classElement, '', '', entities, [])
.process()
.methodsLength;

expect(actual, equals(2));
});
Expand All @@ -54,13 +55,14 @@ void main() {
}
''');

final actual =
DaoProcessor(classElement, '', '', entities).process().methodsLength;
final actual = DaoProcessor(classElement, '', '', entities, [])
.process()
.methodsLength;

expect(actual, equals(3));
});

test('Includes methods form mixin', () async {
test('Includes methods from mixin', () async {
final classElement = await _createDao('''
@dao
abstract class PersonDao with MixinDao<Person> {
Expand All @@ -74,8 +76,9 @@ void main() {
}
''');

final actual =
DaoProcessor(classElement, '', '', entities).process().methodsLength;
final actual = DaoProcessor(classElement, '', '', entities, [])
.process()
.methodsLength;

expect(actual, equals(2));
});
Expand All @@ -94,8 +97,9 @@ void main() {
}
''');

final actual =
DaoProcessor(classElement, '', '', entities).process().methodsLength;
final actual = DaoProcessor(classElement, '', '', entities, [])
.process()
.methodsLength;

expect(actual, equals(2));
});
Expand All @@ -114,8 +118,9 @@ void main() {
}
''');

final actual =
DaoProcessor(classElement, '', '', entities).process().methodsLength;
final actual = DaoProcessor(classElement, '', '', entities, [])
.process()
.methodsLength;

expect(actual, equals(2));
});
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.