* CLDC-4028: Export records where a related one has updated
for instance, re-export all users in an org if the name updates
rework the export code a little to allow for this to be expressed cleanly
* CLDC-4028: Add tests
2 weeks ago
12 changed files with 315 additions and 53 deletions
LettingsLog.exportable.where("(updated_at >= :from AND updated_at <= :to) OR (values_updated_at IS NOT NULL AND values_updated_at >= :from AND values_updated_at <= :to)",params).filter_by_year(year)
SalesLog.exportable.where("(updated_at >= :from AND updated_at <= :to) OR (values_updated_at IS NOT NULL AND values_updated_at >= :from AND values_updated_at <= :to)",params).filter_by_year(year)
User.where("(updated_at >= :from AND updated_at <= :to) OR (values_updated_at IS NOT NULL AND values_updated_at >= :from AND values_updated_at <= :to)",params)
@ -121,19 +121,19 @@ Also ensure you have firefox installed
2. Install the dependencies:
```bash
rbenv exec bundle install && yarn install
bundle install && yarn install
```
3. Create the database & run migrations:
```bash
rbenv exec bundle exec rake db:create db:migrate
bundle exec rake db:create db:migrate
```
4. Seed the database if required:
```bash
rbenv exec bundle exec rake db:seed
bundle exec rake db:seed
```
5. Build assets once before running the app for the first time:
@ -164,7 +164,7 @@ c. Individually:
Rails:
```bash
rbenv exec bundle exec rails s
bundle exec rails s
```
JavaScript (for hot reloading):
@ -183,7 +183,7 @@ You can also insert a new user row using SQL, but you will need to generate a co
### rbenv
In general, whenever needing to run a Ruby command, use `rbenv exec bundle exec <command>` to ensure the correct Ruby version and gemset are used.
In general, whenever needing to run a Ruby command, use `bundle exec <command>` to ensure the correct Ruby version and gemset are used. Rbenv will automatically use the correct Ruby version.
### Debugging
@ -211,7 +211,7 @@ More details on debugging in RubyMine can be found at <https://www.jetbrains.com
### Tests
```bash
rbenv exec bundle exec rspec
bundle exec rspec
```
Or if using RubyMine, right click a spec file and select the 'Run' option.
@ -219,13 +219,13 @@ Or if using RubyMine, right click a spec file and select the 'Run' option.