datasource 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/datasource/base.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 892fcf4ff3a4d4988111a50f2b6773df1d102da1
|
4
|
+
data.tar.gz: a9f398491b40f774f767563e4bb1e022b7aee945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1595cd7d940f7ec47d5b3cae6c242f71516ddf4ba06c62a04aa5518c563e82ddf7108432940c12107eadaf5f290faeb3f89a1d781dbafffd43a70e80a29eb263
|
7
|
+
data.tar.gz: c851fcf944f8f56e9dab25f36f8371f58fd6cb6719f14a27593649ef847e862a4ff5d92c4292b23484eebd7481142c9f86edfd680165dac47d35e76e2e314bd7
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Datasource
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
- Automatically preload associations for your serializers
|
4
|
+
- Specify custom SQL snippets for virtual attributes (Query attributes)
|
5
|
+
- Write custom preloading logic in a reusable way
|
6
6
|
|
7
7
|
#### Install
|
8
8
|
|
data/lib/datasource/base.rb
CHANGED
@@ -123,7 +123,7 @@ module Datasource
|
|
123
123
|
else
|
124
124
|
name = name.to_s
|
125
125
|
if name == "*"
|
126
|
-
|
126
|
+
select_all_columns
|
127
127
|
elsif self.class._attributes.key?(name)
|
128
128
|
unless @expose_attributes.include?(name)
|
129
129
|
@expose_attributes.push(name)
|
@@ -135,7 +135,7 @@ module Datasource
|
|
135
135
|
end
|
136
136
|
end
|
137
137
|
update_dependencies(newly_exposed_attributes) unless newly_exposed_attributes.empty?
|
138
|
-
fail_missing_attributes(missing_attributes) unless missing_attributes.
|
138
|
+
fail_missing_attributes(missing_attributes) unless Datasource.config.simple_mode || missing_attributes.empty?
|
139
139
|
self
|
140
140
|
end
|
141
141
|
|
@@ -146,7 +146,7 @@ module Datasource
|
|
146
146
|
"attribute or association #{names.first} doesn't exist "
|
147
147
|
end
|
148
148
|
message += "for #{self.class.orm_klass.name}, "
|
149
|
-
message += "did you forget to call \"computed :#{
|
149
|
+
message += "did you forget to call \"computed :#{names.first}, <dependencies>\" in your datasource_module?"
|
150
150
|
fail Datasource::Error, message
|
151
151
|
end
|
152
152
|
|