datasource 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/lib/datasource/base.rb +3 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50befc547d1d02c68a29f7a73b5a75ae3038ee16
4
- data.tar.gz: a0866c2dfbfa920696d27d2f83ef4252088c5fe7
3
+ metadata.gz: 892fcf4ff3a4d4988111a50f2b6773df1d102da1
4
+ data.tar.gz: a9f398491b40f774f767563e4bb1e022b7aee945
5
5
  SHA512:
6
- metadata.gz: 1d628e4fc124ece6b97cd373438009a27b37d78f13bc18fbef0fcdc410d1c47fdff43f174feef8f06de694141271950c05449c1da8644c8cf3d150fb22edfcd0
7
- data.tar.gz: f334b8022a8db68d276d22168aaf4e296de0dd9a496c6df22a0a59323a87a2332f0141fa69a4806430f6e9312cfdf983ec560154c7cc07f0eb7d479858a68b56
6
+ metadata.gz: 1595cd7d940f7ec47d5b3cae6c242f71516ddf4ba06c62a04aa5518c563e82ddf7108432940c12107eadaf5f290faeb3f89a1d781dbafffd43a70e80a29eb263
7
+ data.tar.gz: c851fcf944f8f56e9dab25f36f8371f58fd6cb6719f14a27593649ef847e862a4ff5d92c4292b23484eebd7481142c9f86edfd680165dac47d35e76e2e314bd7
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Datasource
2
2
 
3
- **Make sure you are reading the README corresponding to the version your are using**
4
-
5
- Automatically preload your ORM records for your serializer.
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
 
@@ -123,7 +123,7 @@ module Datasource
123
123
  else
124
124
  name = name.to_s
125
125
  if name == "*"
126
- newly_exposed_attributes.concat(select_all_columns.map(&:to_s))
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.blank?
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 :#{name}, <dependencies>\" in your datasource_module?"
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datasource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Berdajs